From 791fc3bb4f99cae2831b67603b583509c1245938 Mon Sep 17 00:00:00 2001 From: azure-powershell-bot <65331932+azure-powershell-bot@users.noreply.github.com> Date: Fri, 7 Nov 2025 07:47:54 +0000 Subject: [PATCH] [skip ci] Archive 211c807b6b7fd435cb27a2673318945d95f6fd16 --- .../Az.HealthcareApis.format.ps1xml | 886 +- .../Az.HealthcareApis.psd1 | 3 +- .../Properties/AssemblyInfo.cs | 4 +- .../check-dependencies.ps1 | 6 +- .../exports/Get-AzHealthcareApisService.ps1 | 21 +- .../exports/Get-AzHealthcareApisWorkspace.ps1 | 21 +- .../exports/Get-AzHealthcareDicomService.ps1 | 44 +- .../Get-AzHealthcareFhirDestination.ps1 | 20 +- .../exports/Get-AzHealthcareFhirService.ps1 | 44 +- .../exports/Get-AzHealthcareIotConnector.ps1 | 44 +- ...zHealthcareIotConnectorFhirDestination.ps1 | 68 +- .../exports/New-AzHealthcareApisService.ps1 | 111 +- .../exports/New-AzHealthcareApisWorkspace.ps1 | 51 +- .../exports/New-AzHealthcareDicomService.ps1 | 127 +- .../exports/New-AzHealthcareFhirService.ps1 | 184 +- .../exports/New-AzHealthcareIotConnector.ps1 | 132 +- ...zHealthcareIotConnectorFhirDestination.ps1 | 130 +- .../exports/ProxyCmdletDefinitions.ps1 | 2130 +- .../Remove-AzHealthcareApisService.ps1 | 17 +- .../Remove-AzHealthcareApisWorkspace.ps1 | 17 +- .../Remove-AzHealthcareDicomService.ps1 | 40 +- .../Remove-AzHealthcareFhirService.ps1 | 40 +- .../Remove-AzHealthcareIotConnector.ps1 | 40 +- ...zHealthcareIotConnectorFhirDestination.ps1 | 64 +- ...st-AzHealthcareServiceNameAvailability.ps1 | 72 +- .../Update-AzHealthcareApisService.ps1 | 53 +- .../Update-AzHealthcareApisWorkspace.ps1 | 46 +- .../Update-AzHealthcareDicomService.ps1 | 81 +- .../Update-AzHealthcareFhirService.ps1 | 186 +- .../Update-AzHealthcareIotConnector.ps1 | 99 +- ...zHealthcareIotConnectorFhirDestination.ps1 | 323 + .../generate-info.json | 2 +- .../generated/Module.cs | 27 +- .../generated/api/HealthcareApis.cs | 18173 ++++++++++++---- .../generated/api/Models/Any.PowerShell.cs | 24 +- .../generated/api/Models/Any.cs | 6 +- .../generated/api/Models/Any.json.cs | 2 +- .../Api20211101/DicomService.PowerShell.cs | 344 - .../Api20211101/FhirService.PowerShell.cs | 480 - .../FhirServiceProperties.PowerShell.cs | 322 - .../Api20211101/IotConnector.PowerShell.cs | 344 - .../IotFhirDestination.PowerShell.cs | 280 - ...ndpointConnectionDescription.PowerShell.cs | 284 - .../ServicesDescription.PowerShell.cs | 464 - .../ServicesProperties.PowerShell.cs | 312 - .../Api20211101/Workspace.PowerShell.cs | 272 - ...ckNameAvailabilityParameters.PowerShell.cs | 50 +- ...ameAvailabilityParameters.TypeConverter.cs | 6 +- .../CheckNameAvailabilityParameters.cs | 12 +- .../CheckNameAvailabilityParameters.json.cs | 12 +- .../api/Models/DicomService.PowerShell.cs | 364 + .../DicomService.TypeConverter.cs | 6 +- .../Models/{Api20211101 => }/DicomService.cs | 227 +- .../{Api20211101 => }/DicomService.json.cs | 18 +- ...eAuthenticationConfiguration.PowerShell.cs | 48 +- ...thenticationConfiguration.TypeConverter.cs | 6 +- ...DicomServiceAuthenticationConfiguration.cs | 24 +- ...ServiceAuthenticationConfiguration.json.cs | 16 +- .../DicomServiceCollection.PowerShell.cs | 50 +- .../DicomServiceCollection.TypeConverter.cs | 6 +- .../DicomServiceCollection.cs | 22 +- .../DicomServiceCollection.json.cs | 12 +- .../DicomServicePatchResource.PowerShell.cs | 66 +- ...DicomServicePatchResource.TypeConverter.cs | 6 +- .../DicomServicePatchResource.cs | 41 +- .../DicomServicePatchResource.json.cs | 12 +- .../DicomServiceProperties.PowerShell.cs | 70 +- .../DicomServiceProperties.TypeConverter.cs | 6 +- .../DicomServiceProperties.cs | 84 +- .../DicomServiceProperties.json.cs | 24 +- .../{Api20211101 => }/Error.PowerShell.cs | 56 +- .../{Api20211101 => }/Error.TypeConverter.cs | 6 +- .../api/Models/{Api20211101 => }/Error.cs | 35 +- .../Models/{Api20211101 => }/Error.json.cs | 12 +- .../ErrorDetails.PowerShell.cs | 56 +- .../ErrorDetails.TypeConverter.cs | 6 +- .../Models/{Api20211101 => }/ErrorDetails.cs | 35 +- .../{Api20211101 => }/ErrorDetails.json.cs | 10 +- .../api/Models/FhirService.PowerShell.cs | 500 + .../FhirService.TypeConverter.cs | 6 +- .../Models/{Api20211101 => }/FhirService.cs | 360 +- .../{Api20211101 => }/FhirService.json.cs | 20 +- ...FhirServiceAccessPolicyEntry.PowerShell.cs | 46 +- ...rServiceAccessPolicyEntry.TypeConverter.cs | 6 +- .../FhirServiceAccessPolicyEntry.cs | 9 +- .../FhirServiceAccessPolicyEntry.json.cs | 10 +- .../FhirServiceAcrConfiguration.PowerShell.cs | 50 +- ...irServiceAcrConfiguration.TypeConverter.cs | 6 +- .../FhirServiceAcrConfiguration.cs | 30 +- .../FhirServiceAcrConfiguration.json.cs | 12 +- ...eAuthenticationConfiguration.PowerShell.cs | 52 +- ...thenticationConfiguration.TypeConverter.cs | 6 +- .../FhirServiceAuthenticationConfiguration.cs | 15 +- ...ServiceAuthenticationConfiguration.json.cs | 14 +- .../FhirServiceCollection.PowerShell.cs | 50 +- .../FhirServiceCollection.TypeConverter.cs | 6 +- .../FhirServiceCollection.cs | 22 +- .../FhirServiceCollection.json.cs | 12 +- ...FhirServiceCorsConfiguration.PowerShell.cs | 62 +- ...rServiceCorsConfiguration.TypeConverter.cs | 6 +- .../FhirServiceCorsConfiguration.cs | 45 +- .../FhirServiceCorsConfiguration.json.cs | 18 +- ...irServiceExportConfiguration.PowerShell.cs | 46 +- ...erviceExportConfiguration.TypeConverter.cs | 6 +- .../FhirServiceExportConfiguration.cs | 9 +- .../FhirServiceExportConfiguration.json.cs | 10 +- .../FhirServicePatchResource.PowerShell.cs | 66 +- .../FhirServicePatchResource.TypeConverter.cs | 6 +- .../FhirServicePatchResource.cs | 41 +- .../FhirServicePatchResource.json.cs | 12 +- .../FhirServiceProperties.PowerShell.cs | 340 + .../FhirServiceProperties.TypeConverter.cs | 6 +- .../FhirServiceProperties.cs | 224 +- .../FhirServiceProperties.json.cs | 34 +- .../HealthcareApisIdentity.PowerShell.cs | 20 + .../api/Models/HealthcareApisIdentity.cs | 39 + .../api/Models/HealthcareApisIdentity.json.cs | 26 +- .../InternalErrorDetails.PowerShell.cs | 54 +- .../InternalErrorDetails.TypeConverter.cs | 6 +- .../{Api20211101 => }/InternalErrorDetails.cs | 21 +- .../InternalErrorDetails.json.cs | 20 +- .../api/Models/IotConnector.PowerShell.cs | 364 + .../IotConnector.TypeConverter.cs | 6 +- .../Models/{Api20211101 => }/IotConnector.cs | 206 +- .../{Api20211101 => }/IotConnector.json.cs | 18 +- .../IotConnectorCollection.PowerShell.cs | 50 +- .../IotConnectorCollection.TypeConverter.cs | 6 +- .../IotConnectorCollection.cs | 22 +- .../IotConnectorCollection.json.cs | 12 +- .../IotConnectorPatchResource.PowerShell.cs | 66 +- ...IotConnectorPatchResource.TypeConverter.cs | 6 +- .../IotConnectorPatchResource.cs | 41 +- .../IotConnectorPatchResource.json.cs | 12 +- .../IotConnectorProperties.PowerShell.cs | 70 +- .../IotConnectorProperties.TypeConverter.cs | 6 +- .../IotConnectorProperties.cs | 65 +- .../IotConnectorProperties.json.cs | 16 +- .../IotDestinationProperties.PowerShell.cs | 46 +- .../IotDestinationProperties.TypeConverter.cs | 6 +- .../IotDestinationProperties.cs | 23 +- .../IotDestinationProperties.json.cs | 12 +- ...gestionEndpointConfiguration.PowerShell.cs | 52 +- ...tionEndpointConfiguration.TypeConverter.cs | 6 +- ...tEventHubIngestionEndpointConfiguration.cs | 15 +- ...tHubIngestionEndpointConfiguration.json.cs | 14 +- .../Models/IotFhirDestination.PowerShell.cs | 300 + .../IotFhirDestination.TypeConverter.cs | 6 +- .../{Api20211101 => }/IotFhirDestination.cs | 178 +- .../IotFhirDestination.json.cs | 16 +- ...IotFhirDestinationCollection.PowerShell.cs | 50 +- ...FhirDestinationCollection.TypeConverter.cs | 6 +- .../IotFhirDestinationCollection.cs | 22 +- .../IotFhirDestinationCollection.json.cs | 12 +- ...IotFhirDestinationProperties.PowerShell.cs | 62 +- ...FhirDestinationProperties.TypeConverter.cs | 6 +- .../IotFhirDestinationProperties.cs | 55 +- .../IotFhirDestinationProperties.json.cs | 16 +- .../IotMappingProperties.PowerShell.cs | 46 +- .../IotMappingProperties.TypeConverter.cs | 6 +- .../{Api20211101 => }/IotMappingProperties.cs | 19 +- .../IotMappingProperties.json.cs | 10 +- .../IotMappingPropertiesContent.PowerShell.cs | 42 +- ...tMappingPropertiesContent.TypeConverter.cs | 6 +- .../IotMappingPropertiesContent.cs | 6 +- .../IotMappingPropertiesContent.dictionary.cs | 4 +- .../IotMappingPropertiesContent.json.cs | 8 +- .../ListOperations.PowerShell.cs | 48 +- .../ListOperations.TypeConverter.cs | 6 +- .../{Api20211101 => }/ListOperations.cs | 24 +- .../{Api20211101 => }/ListOperations.json.cs | 14 +- .../LocationBasedResource.PowerShell.cs | 62 +- .../LocationBasedResource.TypeConverter.cs | 6 +- .../LocationBasedResource.cs | 31 +- .../LocationBasedResource.json.cs | 17 +- .../LogSpecification.PowerShell.cs | 52 +- .../LogSpecification.TypeConverter.cs | 6 +- .../{Api20211101 => }/LogSpecification.cs | 15 +- .../LogSpecification.json.cs | 14 +- .../MetricDimension.PowerShell.cs | 52 +- .../MetricDimension.TypeConverter.cs | 6 +- .../{Api20211101 => }/MetricDimension.cs | 15 +- .../{Api20211101 => }/MetricDimension.json.cs | 14 +- .../MetricSpecification.PowerShell.cs | 84 +- .../MetricSpecification.TypeConverter.cs | 6 +- .../{Api20211101 => }/MetricSpecification.cs | 65 +- .../MetricSpecification.json.cs | 30 +- .../OperationDetail.PowerShell.cs | 92 +- .../OperationDetail.TypeConverter.cs | 6 +- .../{Api20211101 => }/OperationDetail.cs | 108 +- .../{Api20211101 => }/OperationDetail.json.cs | 28 +- .../OperationDisplay.PowerShell.cs | 56 +- .../OperationDisplay.TypeConverter.cs | 6 +- .../{Api20211101 => }/OperationDisplay.cs | 26 +- .../OperationDisplay.json.cs | 24 +- .../OperationProperties.PowerShell.cs | 52 +- .../OperationProperties.TypeConverter.cs | 6 +- .../{Api20211101 => }/OperationProperties.cs | 36 +- .../OperationProperties.json.cs | 10 +- .../OperationResultsDescription.PowerShell.cs | 66 +- ...erationResultsDescription.TypeConverter.cs | 6 +- .../OperationResultsDescription.cs | 46 +- .../OperationResultsDescription.json.cs | 30 +- .../{Api10 => }/PrivateEndpoint.PowerShell.cs | 44 +- .../PrivateEndpoint.TypeConverter.cs | 6 +- .../api/Models/{Api10 => }/PrivateEndpoint.cs | 11 +- .../{Api10 => }/PrivateEndpoint.json.cs | 12 +- .../PrivateEndpointConnection.PowerShell.cs | 84 +- ...PrivateEndpointConnection.TypeConverter.cs | 6 +- .../{Api10 => }/PrivateEndpointConnection.cs | 88 +- .../PrivateEndpointConnection.json.cs | 12 +- ...ndpointConnectionDescription.PowerShell.cs | 304 + ...ointConnectionDescription.TypeConverter.cs | 6 +- .../PrivateEndpointConnectionDescription.cs | 151 +- ...ivateEndpointConnectionDescription.json.cs | 14 +- ...EndpointConnectionListResult.PowerShell.cs | 44 +- ...pointConnectionListResult.TypeConverter.cs | 6 +- .../PrivateEndpointConnectionListResult.cs | 19 +- ...rivateEndpointConnectionListResult.json.cs | 10 +- ...nectionListResultDescription.PowerShell.cs | 44 +- ...tionListResultDescription.TypeConverter.cs | 6 +- ...EndpointConnectionListResultDescription.cs | 19 +- ...intConnectionListResultDescription.json.cs | 10 +- ...EndpointConnectionProperties.PowerShell.cs | 68 +- ...pointConnectionProperties.TypeConverter.cs | 6 +- .../PrivateEndpointConnectionProperties.cs | 69 +- ...rivateEndpointConnectionProperties.json.cs | 16 +- .../PrivateLinkResource.PowerShell.cs | 68 +- .../PrivateLinkResource.TypeConverter.cs | 6 +- .../Models/{Api10 => }/PrivateLinkResource.cs | 62 +- .../{Api10 => }/PrivateLinkResource.json.cs | 12 +- ...ivateLinkResourceDescription.PowerShell.cs | 98 +- ...teLinkResourceDescription.TypeConverter.cs | 6 +- .../PrivateLinkResourceDescription.cs | 137 +- .../PrivateLinkResourceDescription.json.cs | 14 +- ...esourceListResultDescription.PowerShell.cs | 44 +- ...urceListResultDescription.TypeConverter.cs | 6 +- ...rivateLinkResourceListResultDescription.cs | 19 +- ...eLinkResourceListResultDescription.json.cs | 10 +- ...rivateLinkResourceProperties.PowerShell.cs | 54 +- ...ateLinkResourceProperties.TypeConverter.cs | 6 +- .../PrivateLinkResourceProperties.cs | 35 +- .../PrivateLinkResourceProperties.json.cs | 18 +- ...teLinkServiceConnectionState.PowerShell.cs | 52 +- ...inkServiceConnectionState.TypeConverter.cs | 6 +- .../PrivateLinkServiceConnectionState.cs | 27 +- .../PrivateLinkServiceConnectionState.json.cs | 14 +- .../Models/{Api10 => }/Resource.PowerShell.cs | 52 +- .../{Api10 => }/Resource.TypeConverter.cs | 6 +- .../api/Models/{Api10 => }/Resource.cs | 21 +- .../api/Models/{Api10 => }/Resource.json.cs | 20 +- .../ResourceCore.PowerShell.cs | 56 +- .../ResourceCore.TypeConverter.cs | 6 +- .../Models/{Api20211101 => }/ResourceCore.cs | 24 +- .../{Api20211101 => }/ResourceCore.json.cs | 22 +- .../ResourceTags.PowerShell.cs | 40 +- .../ResourceTags.TypeConverter.cs | 6 +- .../Models/{Api20211101 => }/ResourceTags.cs | 6 +- .../ResourceTags.dictionary.cs | 4 +- .../{Api20211101 => }/ResourceTags.json.cs | 8 +- .../ResourceTags1.PowerShell.cs | 44 +- .../ResourceTags1.TypeConverter.cs | 6 +- .../Models/{Api20211101 => }/ResourceTags1.cs | 19 +- .../{Api20211101 => }/ResourceTags1.json.cs | 10 +- ...ceVersionPolicyConfiguration.PowerShell.cs | 48 +- ...ersionPolicyConfiguration.TypeConverter.cs | 6 +- .../ResourceVersionPolicyConfiguration.cs | 34 +- ...ResourceVersionPolicyConfiguration.json.cs | 12 +- ...urationResourceTypeOverrides.PowerShell.cs | 40 +- ...tionResourceTypeOverrides.TypeConverter.cs | 6 +- ...olicyConfigurationResourceTypeOverrides.cs | 8 +- ...urationResourceTypeOverrides.dictionary.cs | 26 +- ...ConfigurationResourceTypeOverrides.json.cs | 12 +- .../ServiceAccessPolicyEntry.PowerShell.cs | 46 +- .../ServiceAccessPolicyEntry.TypeConverter.cs | 6 +- .../ServiceAccessPolicyEntry.cs | 9 +- .../ServiceAccessPolicyEntry.json.cs | 10 +- .../ServiceAcrConfigurationInfo.PowerShell.cs | 50 +- ...rviceAcrConfigurationInfo.TypeConverter.cs | 6 +- .../ServiceAcrConfigurationInfo.cs | 30 +- .../ServiceAcrConfigurationInfo.json.cs | 12 +- ...henticationConfigurationInfo.PowerShell.cs | 52 +- ...ticationConfigurationInfo.TypeConverter.cs | 6 +- .../ServiceAuthenticationConfigurationInfo.cs | 15 +- ...iceAuthenticationConfigurationInfo.json.cs | 14 +- ...ServiceCorsConfigurationInfo.PowerShell.cs | 62 +- ...viceCorsConfigurationInfo.TypeConverter.cs | 6 +- .../ServiceCorsConfigurationInfo.cs | 45 +- .../ServiceCorsConfigurationInfo.json.cs | 18 +- ...iceCosmosDbConfigurationInfo.PowerShell.cs | 48 +- ...CosmosDbConfigurationInfo.TypeConverter.cs | 6 +- .../ServiceCosmosDbConfigurationInfo.cs | 12 +- .../ServiceCosmosDbConfigurationInfo.json.cs | 12 +- ...rviceExportConfigurationInfo.PowerShell.cs | 46 +- ...ceExportConfigurationInfo.TypeConverter.cs | 6 +- .../ServiceExportConfigurationInfo.cs | 9 +- .../ServiceExportConfigurationInfo.json.cs | 10 +- .../ServiceManagedIdentity.PowerShell.cs | 62 +- .../ServiceManagedIdentity.TypeConverter.cs | 6 +- .../ServiceManagedIdentity.cs | 52 +- .../ServiceManagedIdentity.json.cs | 10 +- ... => ServiceManagedIdentity1.PowerShell.cs} | 80 +- ... ServiceManagedIdentity1.TypeConverter.cs} | 32 +- ...enerated.cs => ServiceManagedIdentity1.cs} | 54 +- ...son.cs => ServiceManagedIdentity1.json.cs} | 33 +- .../ServiceOciArtifactEntry.PowerShell.cs | 54 +- .../ServiceOciArtifactEntry.TypeConverter.cs | 6 +- .../ServiceOciArtifactEntry.cs | 15 +- .../ServiceOciArtifactEntry.json.cs | 14 +- .../ServiceSpecification.PowerShell.cs | 50 +- .../ServiceSpecification.TypeConverter.cs | 6 +- .../{Api20211101 => }/ServiceSpecification.cs | 32 +- .../ServiceSpecification.json.cs | 12 +- .../Models/ServicesDescription.PowerShell.cs | 484 + .../ServicesDescription.TypeConverter.cs | 6 +- .../{Api20211101 => }/ServicesDescription.cs | 306 +- .../ServicesDescription.json.cs | 16 +- ...ervicesDescriptionListResult.PowerShell.cs | 50 +- ...icesDescriptionListResult.TypeConverter.cs | 6 +- .../ServicesDescriptionListResult.cs | 22 +- .../ServicesDescriptionListResult.json.cs | 12 +- ...ServicesNameAvailabilityInfo.PowerShell.cs | 54 +- ...vicesNameAvailabilityInfo.TypeConverter.cs | 6 +- .../ServicesNameAvailabilityInfo.cs | 31 +- .../ServicesNameAvailabilityInfo.json.cs | 18 +- .../ServicesPatchDescription.PowerShell.cs | 54 +- .../ServicesPatchDescription.TypeConverter.cs | 6 +- .../ServicesPatchDescription.cs | 40 +- .../ServicesPatchDescription.json.cs | 12 +- ...ServicesPatchDescriptionTags.PowerShell.cs | 42 +- ...vicesPatchDescriptionTags.TypeConverter.cs | 6 +- .../ServicesPatchDescriptionTags.cs | 6 +- ...ServicesPatchDescriptionTags.dictionary.cs | 4 +- .../ServicesPatchDescriptionTags.json.cs | 8 +- .../Models/ServicesProperties.PowerShell.cs | 332 + .../ServicesProperties.TypeConverter.cs | 6 +- .../{Api20211101 => }/ServicesProperties.cs | 191 +- .../ServicesProperties.json.cs | 28 +- ...esPropertiesUpdateParameters.PowerShell.cs | 44 +- ...ropertiesUpdateParameters.TypeConverter.cs | 6 +- .../ServicesPropertiesUpdateParameters.cs | 21 +- ...ServicesPropertiesUpdateParameters.json.cs | 10 +- .../ServicesResource.PowerShell.cs | 84 +- .../ServicesResource.TypeConverter.cs | 6 +- .../{Api20211101 => }/ServicesResource.cs | 92 +- .../ServicesResource.json.cs | 35 +- .../ServicesResourceIdentity.PowerShell.cs | 54 +- .../ServicesResourceIdentity.TypeConverter.cs | 6 +- .../ServicesResourceIdentity.cs | 31 +- .../ServicesResourceIdentity.json.cs | 18 +- .../ServicesResourceTags.PowerShell.cs | 42 +- .../ServicesResourceTags.TypeConverter.cs | 6 +- .../{Api20211101 => }/ServicesResourceTags.cs | 6 +- .../ServicesResourceTags.dictionary.cs | 4 +- .../ServicesResourceTags.json.cs | 8 +- .../{Api10 => }/SystemData.PowerShell.cs | 64 +- .../{Api10 => }/SystemData.TypeConverter.cs | 6 +- .../api/Models/{Api10 => }/SystemData.cs | 48 +- .../api/Models/{Api10 => }/SystemData.json.cs | 20 +- .../TaggedResource.PowerShell.cs | 64 +- .../TaggedResource.TypeConverter.cs | 6 +- .../{Api20211101 => }/TaggedResource.cs | 40 +- .../{Api20211101 => }/TaggedResource.json.cs | 12 +- .../UserAssignedIdentities.PowerShell.cs | 42 +- .../UserAssignedIdentities.TypeConverter.cs | 6 +- .../UserAssignedIdentities.cs | 8 +- .../UserAssignedIdentities.dictionary.cs | 26 +- .../UserAssignedIdentities.json.cs | 12 +- .../UserAssignedIdentity.PowerShell.cs | 50 +- .../UserAssignedIdentity.TypeConverter.cs | 6 +- .../{Api20211101 => }/UserAssignedIdentity.cs | 16 +- .../UserAssignedIdentity.json.cs | 16 +- .../api/Models/Workspace.PowerShell.cs | 292 + .../Workspace.TypeConverter.cs | 6 +- .../api/Models/{Api20211101 => }/Workspace.cs | 173 +- .../{Api20211101 => }/Workspace.json.cs | 16 +- .../WorkspaceList.PowerShell.cs | 48 +- .../WorkspaceList.TypeConverter.cs | 6 +- .../Models/{Api20211101 => }/WorkspaceList.cs | 22 +- .../{Api20211101 => }/WorkspaceList.json.cs | 12 +- .../WorkspacePatchResource.PowerShell.cs | 46 +- .../WorkspacePatchResource.TypeConverter.cs | 6 +- .../WorkspacePatchResource.cs | 16 +- .../WorkspacePatchResource.json.cs | 10 +- .../WorkspaceProperties.PowerShell.cs | 52 +- .../WorkspaceProperties.TypeConverter.cs | 6 +- .../{Api20211101 => }/WorkspaceProperties.cs | 53 +- .../WorkspaceProperties.json.cs | 18 +- .../api/Support/ActionType.Completer.cs | 37 - .../api/Support/ActionType.TypeConverter.cs | 61 - .../generated/api/Support/ActionType.cs | 98 - .../api/Support/CreatedByType.Completer.cs | 47 - .../Support/CreatedByType.TypeConverter.cs | 59 - .../generated/api/Support/CreatedByType.cs | 102 - .../FhirResourceVersionPolicy.Completer.cs | 43 - ...FhirResourceVersionPolicy.TypeConverter.cs | 59 - .../api/Support/FhirResourceVersionPolicy.cs | 100 - .../api/Support/FhirServiceKind.Completer.cs | 39 - .../Support/FhirServiceKind.TypeConverter.cs | 59 - .../generated/api/Support/FhirServiceKind.cs | 98 - .../IotIdentityResolutionType.Completer.cs | 39 - ...IotIdentityResolutionType.TypeConverter.cs | 59 - .../api/Support/IotIdentityResolutionType.cs | 98 - .../generated/api/Support/Kind.Completer.cs | 43 - .../api/Support/Kind.TypeConverter.cs | 59 - .../generated/api/Support/Kind.cs | 100 - .../ManagedServiceIdentityType.Completer.cs | 41 - ...anagedServiceIdentityType.TypeConverter.cs | 61 - .../api/Support/ManagedServiceIdentityType.cs | 102 - .../OperationResultStatus.Completer.cs | 51 - .../OperationResultStatus.TypeConverter.cs | 59 - .../api/Support/OperationResultStatus.cs | 104 - ...ntConnectionProvisioningState.Completer.cs | 47 - ...nnectionProvisioningState.TypeConverter.cs | 59 - ...vateEndpointConnectionProvisioningState.cs | 112 - ...dpointServiceConnectionStatus.Completer.cs | 43 - ...ntServiceConnectionStatus.TypeConverter.cs | 59 - .../PrivateEndpointServiceConnectionStatus.cs | 106 - .../Support/ProvisioningState.Completer.cs | 83 - .../ProvisioningState.TypeConverter.cs | 59 - .../api/Support/ProvisioningState.cs | 120 - .../Support/PublicNetworkAccess.Completer.cs | 41 - .../PublicNetworkAccess.TypeConverter.cs | 61 - .../api/Support/PublicNetworkAccess.cs | 100 - .../Support/ServiceEventState.Completer.cs | 43 - .../ServiceEventState.TypeConverter.cs | 59 - .../api/Support/ServiceEventState.cs | 100 - .../ServiceManagedIdentityType.Completer.cs | 49 - ...erviceManagedIdentityType.TypeConverter.cs | 61 - .../api/Support/ServiceManagedIdentityType.cs | 106 - ...rviceNameUnavailabilityReason.Completer.cs | 39 - ...eNameUnavailabilityReason.TypeConverter.cs | 59 - .../ServiceNameUnavailabilityReason.cs | 104 - .../cmdlets/GetAzHealthcareApisService_Get.cs | 113 +- ...tAzHealthcareApisService_GetViaIdentity.cs | 106 +- .../GetAzHealthcareApisService_List.cs | 120 +- .../GetAzHealthcareApisService_List1.cs | 120 +- .../GetAzHealthcareApisWorkspace_Get.cs | 115 +- ...zHealthcareApisWorkspace_GetViaIdentity.cs | 116 +- .../GetAzHealthcareApisWorkspace_List.cs | 120 +- .../GetAzHealthcareApisWorkspace_List1.cs | 120 +- .../GetAzHealthcareDicomService_Get.cs | 115 +- ...AzHealthcareDicomService_GetViaIdentity.cs | 116 +- ...areDicomService_GetViaIdentityWorkspace.cs | 501 + .../GetAzHealthcareDicomService_List.cs | 122 +- .../GetAzHealthcareFhirDestination_List.cs | 121 +- .../cmdlets/GetAzHealthcareFhirService_Get.cs | 115 +- ...tAzHealthcareFhirService_GetViaIdentity.cs | 116 +- ...areFhirService_GetViaIdentityWorkspace.cs} | 174 +- .../GetAzHealthcareFhirService_List.cs | 122 +- ...althcareIotConnectorFhirDestination_Get.cs | 114 +- ...ConnectorFhirDestination_GetViaIdentity.cs | 115 +- ...rDestination_GetViaIdentityIotconnector.cs | 505 + ...FhirDestination_GetViaIdentityWorkspace.cs | 515 + .../GetAzHealthcareIotConnector_Get.cs | 114 +- ...AzHealthcareIotConnector_GetViaIdentity.cs | 115 +- ...areIotConnector_GetViaIdentityWorkspace.cs | 501 + .../GetAzHealthcareIotConnector_List.cs | 121 +- .../GetAzHealthcareOperationResult_Get.cs | 112 +- ...ealthcareOperationResult_GetViaIdentity.cs | 105 +- ...OperationResult_GetViaIdentityLocation.cs} | 169 +- .../cmdlets/GetAzHealthcareOperation_List.cs | 112 +- ...ealthcarePrivateEndpointConnection_List.cs | 439 - ...GetAzHealthcarePrivateLinkResource_List.cs | 439 - ...eWorkspacePrivateEndpointConnection_Get.cs | 112 +- ...rivateEndpointConnection_GetViaIdentity.cs | 105 +- ...ointConnection_GetViaIdentityWorkspace.cs} | 213 +- ...WorkspacePrivateEndpointConnection_List.cs | 116 +- ...lthcareWorkspacePrivateLinkResource_Get.cs | 112 +- ...spacePrivateLinkResource_GetViaIdentity.cs | 105 +- ...teLinkResource_GetViaIdentityWorkspace.cs} | 198 +- ...thcareWorkspacePrivateLinkResource_List.cs | 116 +- ...wAzHealthcareApisService_CreateExpanded.cs | 161 +- ...thcareApisService_CreateViaJsonFilePath.cs | 576 + ...lthcareApisService_CreateViaJsonString.cs} | 221 +- ...zHealthcareApisWorkspace_CreateExpanded.cs | 119 +- ...careApisWorkspace_CreateViaJsonFilePath.cs | 577 + ...thcareApisWorkspace_CreateViaJsonString.cs | 575 + ...AzHealthcareDicomService_CreateExpanded.cs | 187 +- ...vice_CreateViaIdentityWorkspaceExpanded.cs | 650 + ...hcareDicomService_CreateViaJsonFilePath.cs | 592 + ...lthcareDicomService_CreateViaJsonString.cs | 590 + ...wAzHealthcareFhirService_CreateExpanded.cs | 219 +- ...vice_CreateViaIdentityWorkspaceExpanded.cs | 824 + ...hcareFhirService_CreateViaJsonFilePath.cs} | 222 +- ...althcareFhirService_CreateViaJsonString.cs | 590 + ...ConnectorFhirDestination_CreateExpanded.cs | 119 +- ...n_CreateViaIdentityIotconnectorExpanded.cs | 625 + ...tion_CreateViaIdentityWorkspaceExpanded.cs | 636 + ...orFhirDestination_CreateViaJsonFilePath.cs | 611 + ...ctorFhirDestination_CreateViaJsonString.cs | 609 + ...AzHealthcareIotConnector_CreateExpanded.cs | 185 +- ...ctor_CreateViaIdentityWorkspaceExpanded.cs | 681 + ...hcareIotConnector_CreateViaJsonFilePath.cs | 592 + ...lthcareIotConnector_CreateViaJsonString.cs | 590 + ...rivateEndpointConnection_CreateExpanded.cs | 113 +- ...tion_CreateViaIdentityWorkspaceExpanded.cs | 600 + ...ndpointConnection_CreateViaJsonFilePath.cs | 596 + ...eEndpointConnection_CreateViaJsonString.cs | 594 + .../RemoveAzHealthcareApisService_Delete.cs | 88 +- ...HealthcareApisService_DeleteViaIdentity.cs | 81 +- .../RemoveAzHealthcareApisWorkspace_Delete.cs | 88 +- ...althcareApisWorkspace_DeleteViaIdentity.cs | 81 +- .../RemoveAzHealthcareDicomService_Delete.cs | 88 +- ...ealthcareDicomService_DeleteViaIdentity.cs | 81 +- ...omService_DeleteViaIdentityDicomservice.cs | 592 + .../RemoveAzHealthcareFhirService_Delete.cs | 88 +- ...HealthcareFhirService_DeleteViaIdentity.cs | 81 +- ...irService_DeleteViaIdentityFhirservice.cs} | 158 +- ...hcareIotConnectorFhirDestination_Delete.cs | 88 +- ...nectorFhirDestination_DeleteViaIdentity.cs | 81 +- ...stination_DeleteViaIdentityIotconnector.cs | 597 + ...rDestination_DeleteViaIdentityWorkspace.cs | 608 + .../RemoveAzHealthcareIotConnector_Delete.cs | 88 +- ...ealthcareIotConnector_DeleteViaIdentity.cs | 81 +- ...Connector_DeleteViaIdentityIotconnector.cs | 592 + ...rkspacePrivateEndpointConnection_Delete.cs | 88 +- ...ateEndpointConnection_DeleteViaIdentity.cs | 81 +- ...ntConnection_DeleteViaIdentityWorkspace.cs | 594 + ...HealthcareServiceNameAvailability_Check.cs | 119 +- ...reServiceNameAvailability_CheckExpanded.cs | 114 +- ...eNameAvailability_CheckViaJsonFilePath.cs} | 184 +- ...iceNameAvailability_CheckViaJsonString.cs} | 185 +- ...eAzHealthcareApisService_UpdateExpanded.cs | 118 +- ...reApisService_UpdateViaIdentityExpanded.cs | 117 +- ...thcareApisService_UpdateViaJsonFilePath.cs | 575 + ...althcareApisService_UpdateViaJsonString.cs | 573 + ...zHealthcareApisWorkspace_UpdateExpanded.cs | 114 +- ...ApisWorkspace_UpdateViaIdentityExpanded.cs | 119 +- ...careApisWorkspace_UpdateViaJsonFilePath.cs | 576 + ...thcareApisWorkspace_UpdateViaJsonString.cs | 574 + ...AzHealthcareDicomService_UpdateExpanded.cs | 252 +- ...eDicomService_UpdateViaIdentityExpanded.cs | 262 +- ...vice_UpdateViaIdentityWorkspaceExpanded.cs | 671 + ...eAzHealthcareFhirService_UpdateExpanded.cs | 480 +- ...reFhirService_UpdateViaIdentityExpanded.cs | 492 +- ...vice_UpdateViaIdentityWorkspaceExpanded.cs | 905 + ...ConnectorFhirDestination_UpdateExpanded.cs | 666 + ...irDestination_UpdateViaIdentityExpanded.cs | 625 + ...n_UpdateViaIdentityIotconnectorExpanded.cs | 637 + ...tion_UpdateViaIdentityWorkspaceExpanded.cs | 648 + ...AzHealthcareIotConnector_UpdateExpanded.cs | 275 +- ...eIotConnector_UpdateViaIdentityExpanded.cs | 285 +- ...ctor_UpdateViaIdentityWorkspaceExpanded.cs | 714 + ...rivateEndpointConnection_UpdateExpanded.cs | 639 + ...intConnection_UpdateViaIdentityExpanded.cs | 608 + ...tion_UpdateViaIdentityWorkspaceExpanded.cs | 620 + .../Attributes/ExternalDocsAttribute.cs | 30 + .../PSArgumentCompleterAttribute.cs | 52 + .../BuildTime/Cmdlets/ExportFormatPs1xml.cs | 6 +- .../BuildTime/Cmdlets/ExportModelSurface.cs | 2 +- .../BuildTime/Cmdlets/ExportProxyCmdlet.cs | 4 +- .../runtime/BuildTime/Cmdlets/ExportPsd1.cs | 8 +- .../BuildTime/Cmdlets/ExportTestStub.cs | 211 +- .../runtime/BuildTime/MarkdownRenderer.cs | 2 +- .../runtime/BuildTime/Models/PsHelpTypes.cs | 11 +- .../BuildTime/Models/PsMarkdownTypes.cs | 43 +- .../BuildTime/Models/PsProxyOutputs.cs | 60 +- .../runtime/BuildTime/Models/PsProxyTypes.cs | 57 +- .../runtime/BuildTime/PsAttributes.cs | 15 + .../runtime/BuildTime/PsExtensions.cs | 7 + .../generated/runtime/BuildTime/PsHelpers.cs | 4 +- .../generated/runtime/Context.cs | 33 + .../generated/runtime/Events.cs | 4 +- .../generated/runtime/ISendAsync.cs | 113 + .../generated/runtime/InfoAttribute.cs | 4 + .../generated/runtime/InputHandler.cs | 22 + .../generated/runtime/MessageAttribute.cs | 11 +- .../runtime/Nodes/Collections/XNodeArray.cs | 5 + .../runtime/Properties/Resources.resx | 2 +- .../generated/runtime/SerializationMode.cs | 8 +- .../runtime/TypeConverterExtensions.cs | 50 + .../internal/Get-AzHealthcareOperation.ps1 | 10 +- .../Get-AzHealthcareOperationResult.ps1 | 38 +- ...-AzHealthcarePrivateEndpointConnection.ps1 | 193 - .../Get-AzHealthcarePrivateLinkResource.ps1 | 192 - ...careWorkspacePrivateEndpointConnection.ps1 | 38 +- ...HealthcareWorkspacePrivateLinkResource.ps1 | 38 +- .../internal/New-AzHealthcareApisService.ps1 | 106 +- .../New-AzHealthcareApisWorkspace.ps1 | 46 +- .../internal/New-AzHealthcareDicomService.ps1 | 130 +- .../internal/New-AzHealthcareFhirService.ps1 | 187 +- .../internal/New-AzHealthcareIotConnector.ps1 | 137 +- ...zHealthcareIotConnectorFhirDestination.ps1 | 133 +- ...-AzHealthcarePrivateEndpointConnection.ps1 | 191 - ...careWorkspacePrivateEndpointConnection.ps1 | 93 +- .../internal/ProxyCmdletDefinitions.ps1 | 2161 +- ...careWorkspacePrivateEndpointConnection.ps1 | 34 +- ...areWorkspacePrivateEndpointConnection.ps1} | 100 +- .../HealthcareApis.Autorest/test-module.ps1 | 10 +- 589 files changed, 62508 insertions(+), 21493 deletions(-) create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareIotConnectorFhirDestination.ps1 delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomService.PowerShell.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirService.PowerShell.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceProperties.PowerShell.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnector.PowerShell.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestination.PowerShell.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionDescription.PowerShell.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescription.PowerShell.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesProperties.PowerShell.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Workspace.PowerShell.cs rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/CheckNameAvailabilityParameters.PowerShell.cs (73%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/CheckNameAvailabilityParameters.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/CheckNameAvailabilityParameters.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/CheckNameAvailabilityParameters.json.cs (94%) create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomService.PowerShell.cs rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomService.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomService.cs (55%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomService.json.cs (92%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomServiceAuthenticationConfiguration.PowerShell.cs (71%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomServiceAuthenticationConfiguration.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomServiceAuthenticationConfiguration.cs (77%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomServiceAuthenticationConfiguration.json.cs (92%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomServiceCollection.PowerShell.cs (70%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomServiceCollection.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomServiceCollection.cs (77%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomServiceCollection.json.cs (91%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomServicePatchResource.PowerShell.cs (59%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomServicePatchResource.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomServicePatchResource.cs (60%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomServicePatchResource.json.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomServiceProperties.PowerShell.cs (55%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomServiceProperties.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomServiceProperties.cs (56%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/DicomServiceProperties.json.cs (89%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/Error.PowerShell.cs (69%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/Error.TypeConverter.cs (98%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/Error.cs (68%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/Error.json.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ErrorDetails.PowerShell.cs (68%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ErrorDetails.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ErrorDetails.cs (68%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ErrorDetails.json.cs (94%) create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirService.PowerShell.cs rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirService.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirService.cs (54%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirService.json.cs (92%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceAccessPolicyEntry.PowerShell.cs (76%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceAccessPolicyEntry.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceAccessPolicyEntry.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceAccessPolicyEntry.json.cs (95%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceAcrConfiguration.PowerShell.cs (67%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceAcrConfiguration.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceAcrConfiguration.cs (69%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceAcrConfiguration.json.cs (87%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceAuthenticationConfiguration.PowerShell.cs (69%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceAuthenticationConfiguration.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceAuthenticationConfiguration.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceAuthenticationConfiguration.json.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceCollection.PowerShell.cs (70%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceCollection.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceCollection.cs (77%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceCollection.json.cs (91%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceCorsConfiguration.PowerShell.cs (62%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceCorsConfiguration.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceCorsConfiguration.cs (79%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceCorsConfiguration.json.cs (87%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceExportConfiguration.PowerShell.cs (76%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceExportConfiguration.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceExportConfiguration.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceExportConfiguration.json.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServicePatchResource.PowerShell.cs (59%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServicePatchResource.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServicePatchResource.cs (60%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServicePatchResource.json.cs (93%) create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceProperties.PowerShell.cs rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceProperties.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceProperties.cs (54%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/FhirServiceProperties.json.cs (84%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/InternalErrorDetails.PowerShell.cs (71%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/InternalErrorDetails.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/InternalErrorDetails.cs (87%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/InternalErrorDetails.json.cs (93%) create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnector.PowerShell.cs rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotConnector.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotConnector.cs (58%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotConnector.json.cs (92%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotConnectorCollection.PowerShell.cs (69%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotConnectorCollection.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotConnectorCollection.cs (77%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotConnectorCollection.json.cs (91%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotConnectorPatchResource.PowerShell.cs (59%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotConnectorPatchResource.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotConnectorPatchResource.cs (60%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotConnectorPatchResource.json.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotConnectorProperties.PowerShell.cs (56%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotConnectorProperties.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotConnectorProperties.cs (60%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotConnectorProperties.json.cs (92%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotDestinationProperties.PowerShell.cs (76%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotDestinationProperties.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotDestinationProperties.cs (63%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotDestinationProperties.json.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotEventHubIngestionEndpointConfiguration.PowerShell.cs (68%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotEventHubIngestionEndpointConfiguration.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotEventHubIngestionEndpointConfiguration.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotEventHubIngestionEndpointConfiguration.json.cs (94%) create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestination.PowerShell.cs rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotFhirDestination.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotFhirDestination.cs (57%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotFhirDestination.json.cs (92%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotFhirDestinationCollection.PowerShell.cs (69%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotFhirDestinationCollection.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotFhirDestinationCollection.cs (77%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotFhirDestinationCollection.json.cs (90%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotFhirDestinationProperties.PowerShell.cs (61%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotFhirDestinationProperties.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotFhirDestinationProperties.cs (64%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotFhirDestinationProperties.json.cs (92%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotMappingProperties.PowerShell.cs (74%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotMappingProperties.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotMappingProperties.cs (77%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotMappingProperties.json.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotMappingPropertiesContent.PowerShell.cs (80%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotMappingPropertiesContent.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotMappingPropertiesContent.cs (92%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotMappingPropertiesContent.dictionary.cs (96%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/IotMappingPropertiesContent.json.cs (95%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ListOperations.PowerShell.cs (70%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ListOperations.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ListOperations.cs (75%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ListOperations.json.cs (91%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/LocationBasedResource.PowerShell.cs (68%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/LocationBasedResource.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/LocationBasedResource.cs (73%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/LocationBasedResource.json.cs (88%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/LogSpecification.PowerShell.cs (71%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/LogSpecification.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/LogSpecification.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/LogSpecification.json.cs (95%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/MetricDimension.PowerShell.cs (71%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/MetricDimension.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/MetricDimension.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/MetricDimension.json.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/MetricSpecification.PowerShell.cs (54%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/MetricSpecification.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/MetricSpecification.cs (83%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/MetricSpecification.json.cs (87%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/OperationDetail.PowerShell.cs (50%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/OperationDetail.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/OperationDetail.cs (65%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/OperationDetail.json.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/OperationDisplay.PowerShell.cs (69%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/OperationDisplay.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/OperationDisplay.cs (87%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/OperationDisplay.json.cs (95%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/OperationProperties.PowerShell.cs (61%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/OperationProperties.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/OperationProperties.cs (55%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/OperationProperties.json.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/OperationResultsDescription.PowerShell.cs (63%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/OperationResultsDescription.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/OperationResultsDescription.cs (83%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/OperationResultsDescription.json.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateEndpoint.PowerShell.cs (77%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateEndpoint.TypeConverter.cs (98%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateEndpoint.cs (91%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateEndpoint.json.cs (95%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateEndpointConnection.PowerShell.cs (53%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateEndpointConnection.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateEndpointConnection.cs (60%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateEndpointConnection.json.cs (93%) create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionDescription.PowerShell.cs rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateEndpointConnectionDescription.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateEndpointConnectionDescription.cs (50%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateEndpointConnectionDescription.json.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateEndpointConnectionListResult.PowerShell.cs (71%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateEndpointConnectionListResult.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateEndpointConnectionListResult.cs (71%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateEndpointConnectionListResult.json.cs (90%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateEndpointConnectionListResultDescription.PowerShell.cs (70%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateEndpointConnectionListResultDescription.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateEndpointConnectionListResultDescription.cs (70%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateEndpointConnectionListResultDescription.json.cs (89%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateEndpointConnectionProperties.PowerShell.cs (56%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateEndpointConnectionProperties.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateEndpointConnectionProperties.cs (61%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateEndpointConnectionProperties.json.cs (92%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateLinkResource.PowerShell.cs (61%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateLinkResource.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateLinkResource.cs (63%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateLinkResource.json.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateLinkResourceDescription.PowerShell.cs (50%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateLinkResourceDescription.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateLinkResourceDescription.cs (53%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateLinkResourceDescription.json.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateLinkResourceListResultDescription.PowerShell.cs (71%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateLinkResourceListResultDescription.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateLinkResourceListResultDescription.cs (69%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/PrivateLinkResourceListResultDescription.json.cs (89%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateLinkResourceProperties.PowerShell.cs (67%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateLinkResourceProperties.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateLinkResourceProperties.cs (74%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateLinkResourceProperties.json.cs (90%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateLinkServiceConnectionState.PowerShell.cs (70%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateLinkServiceConnectionState.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateLinkServiceConnectionState.cs (85%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/PrivateLinkServiceConnectionState.json.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/Resource.PowerShell.cs (73%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/Resource.TypeConverter.cs (98%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/Resource.cs (91%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/Resource.json.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceCore.PowerShell.cs (70%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceCore.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceCore.cs (90%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceCore.json.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceTags.PowerShell.cs (81%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceTags.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceTags.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceTags.dictionary.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceTags.json.cs (96%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceTags1.PowerShell.cs (76%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceTags1.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceTags1.cs (82%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceTags1.json.cs (95%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceVersionPolicyConfiguration.PowerShell.cs (69%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceVersionPolicyConfiguration.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceVersionPolicyConfiguration.cs (67%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceVersionPolicyConfiguration.json.cs (92%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceVersionPolicyConfigurationResourceTypeOverrides.PowerShell.cs (80%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceVersionPolicyConfigurationResourceTypeOverrides.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceVersionPolicyConfigurationResourceTypeOverrides.cs (84%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceVersionPolicyConfigurationResourceTypeOverrides.dictionary.cs (54%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ResourceVersionPolicyConfigurationResourceTypeOverrides.json.cs (90%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceAccessPolicyEntry.PowerShell.cs (76%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceAccessPolicyEntry.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceAccessPolicyEntry.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceAccessPolicyEntry.json.cs (95%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceAcrConfigurationInfo.PowerShell.cs (67%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceAcrConfigurationInfo.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceAcrConfigurationInfo.cs (68%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceAcrConfigurationInfo.json.cs (87%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceAuthenticationConfigurationInfo.PowerShell.cs (69%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceAuthenticationConfigurationInfo.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceAuthenticationConfigurationInfo.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceAuthenticationConfigurationInfo.json.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceCorsConfigurationInfo.PowerShell.cs (62%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceCorsConfigurationInfo.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceCorsConfigurationInfo.cs (79%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceCorsConfigurationInfo.json.cs (87%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceCosmosDbConfigurationInfo.PowerShell.cs (72%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceCosmosDbConfigurationInfo.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceCosmosDbConfigurationInfo.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceCosmosDbConfigurationInfo.json.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceExportConfigurationInfo.PowerShell.cs (76%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceExportConfigurationInfo.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceExportConfigurationInfo.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceExportConfigurationInfo.json.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceManagedIdentity.PowerShell.cs (62%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceManagedIdentity.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceManagedIdentity.cs (70%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceManagedIdentity.json.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101/ServiceManagedIdentityAutoGenerated.PowerShell.cs => ServiceManagedIdentity1.PowerShell.cs} (60%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101/ServiceManagedIdentityAutoGenerated.TypeConverter.cs => ServiceManagedIdentity1.TypeConverter.cs} (82%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101/ServiceManagedIdentityAutoGenerated.cs => ServiceManagedIdentity1.cs} (79%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101/ServiceManagedIdentityAutoGenerated.json.cs => ServiceManagedIdentity1.json.cs} (88%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceOciArtifactEntry.PowerShell.cs (70%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceOciArtifactEntry.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceOciArtifactEntry.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceOciArtifactEntry.json.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceSpecification.PowerShell.cs (65%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceSpecification.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceSpecification.cs (62%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServiceSpecification.json.cs (87%) create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescription.PowerShell.cs rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesDescription.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesDescription.cs (56%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesDescription.json.cs (92%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesDescriptionListResult.PowerShell.cs (69%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesDescriptionListResult.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesDescriptionListResult.cs (77%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesDescriptionListResult.json.cs (90%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesNameAvailabilityInfo.PowerShell.cs (70%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesNameAvailabilityInfo.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesNameAvailabilityInfo.cs (77%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesNameAvailabilityInfo.json.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesPatchDescription.PowerShell.cs (66%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesPatchDescription.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesPatchDescription.cs (62%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesPatchDescription.json.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesPatchDescriptionTags.PowerShell.cs (80%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesPatchDescriptionTags.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesPatchDescriptionTags.cs (91%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesPatchDescriptionTags.dictionary.cs (96%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesPatchDescriptionTags.json.cs (95%) create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesProperties.PowerShell.cs rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesProperties.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesProperties.cs (59%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesProperties.json.cs (83%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesPropertiesUpdateParameters.PowerShell.cs (75%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesPropertiesUpdateParameters.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesPropertiesUpdateParameters.cs (74%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesPropertiesUpdateParameters.json.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesResource.PowerShell.cs (55%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesResource.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesResource.cs (73%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesResource.json.cs (88%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesResourceIdentity.PowerShell.cs (71%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesResourceIdentity.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesResourceIdentity.cs (81%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesResourceIdentity.json.cs (95%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesResourceTags.PowerShell.cs (81%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesResourceTags.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesResourceTags.cs (92%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesResourceTags.dictionary.cs (96%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/ServicesResourceTags.json.cs (95%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/SystemData.PowerShell.cs (63%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/SystemData.TypeConverter.cs (98%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/SystemData.cs (80%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api10 => }/SystemData.json.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/TaggedResource.PowerShell.cs (65%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/TaggedResource.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/TaggedResource.cs (63%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/TaggedResource.json.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/UserAssignedIdentities.PowerShell.cs (82%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/UserAssignedIdentities.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/UserAssignedIdentities.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/UserAssignedIdentities.dictionary.cs (66%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/UserAssignedIdentities.json.cs (91%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/UserAssignedIdentity.PowerShell.cs (73%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/UserAssignedIdentity.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/UserAssignedIdentity.cs (88%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/UserAssignedIdentity.json.cs (95%) create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Workspace.PowerShell.cs rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/Workspace.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/Workspace.cs (56%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/Workspace.json.cs (93%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/WorkspaceList.PowerShell.cs (70%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/WorkspaceList.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/WorkspaceList.cs (77%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/WorkspaceList.json.cs (91%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/WorkspacePatchResource.PowerShell.cs (75%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/WorkspacePatchResource.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/WorkspacePatchResource.cs (78%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/WorkspacePatchResource.json.cs (94%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/WorkspaceProperties.PowerShell.cs (66%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/WorkspaceProperties.TypeConverter.cs (97%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/WorkspaceProperties.cs (57%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/{Api20211101 => }/WorkspaceProperties.json.cs (90%) delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ActionType.Completer.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ActionType.TypeConverter.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ActionType.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/CreatedByType.Completer.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/CreatedByType.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirResourceVersionPolicy.Completer.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirResourceVersionPolicy.TypeConverter.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirResourceVersionPolicy.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirServiceKind.Completer.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirServiceKind.TypeConverter.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirServiceKind.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/IotIdentityResolutionType.Completer.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/IotIdentityResolutionType.TypeConverter.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/IotIdentityResolutionType.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/Kind.Completer.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/Kind.TypeConverter.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/Kind.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ManagedServiceIdentityType.Completer.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ManagedServiceIdentityType.TypeConverter.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ManagedServiceIdentityType.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/OperationResultStatus.Completer.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/OperationResultStatus.TypeConverter.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/OperationResultStatus.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.Completer.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.TypeConverter.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.Completer.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.TypeConverter.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ProvisioningState.Completer.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ProvisioningState.TypeConverter.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ProvisioningState.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PublicNetworkAccess.Completer.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PublicNetworkAccess.TypeConverter.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PublicNetworkAccess.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceEventState.Completer.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceEventState.TypeConverter.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceEventState.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceManagedIdentityType.Completer.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceManagedIdentityType.TypeConverter.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceManagedIdentityType.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceNameUnavailabilityReason.Completer.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceNameUnavailabilityReason.TypeConverter.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceNameUnavailabilityReason.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareDicomService_GetViaIdentityWorkspace.cs rename generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/{GetAzHealthcarePrivateLinkResource_GetViaIdentity.cs => GetAzHealthcareFhirService_GetViaIdentityWorkspace.cs} (75%) create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnectorFhirDestination_GetViaIdentityIotconnector.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnectorFhirDestination_GetViaIdentityWorkspace.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnector_GetViaIdentityWorkspace.cs rename generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/{GetAzHealthcarePrivateEndpointConnection_GetViaIdentity.cs => GetAzHealthcareOperationResult_GetViaIdentityLocation.cs} (75%) delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateEndpointConnection_List.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateLinkResource_List.cs rename generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/{GetAzHealthcarePrivateEndpointConnection_Get.cs => GetAzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentityWorkspace.cs} (71%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/{GetAzHealthcarePrivateLinkResource_Get.cs => GetAzHealthcareWorkspacePrivateLinkResource_GetViaIdentityWorkspace.cs} (73%) create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisService_CreateViaJsonFilePath.cs rename generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/{RemoveAzHealthcarePrivateEndpointConnection_Delete.cs => NewAzHealthcareApisService_CreateViaJsonString.cs} (79%) create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisWorkspace_CreateViaJsonFilePath.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisWorkspace_CreateViaJsonString.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareDicomService_CreateViaIdentityWorkspaceExpanded.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareDicomService_CreateViaJsonFilePath.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareDicomService_CreateViaJsonString.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareFhirService_CreateViaIdentityWorkspaceExpanded.cs rename generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/{NewAzHealthcarePrivateEndpointConnection_CreateExpanded.cs => NewAzHealthcareFhirService_CreateViaJsonFilePath.cs} (79%) create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareFhirService_CreateViaJsonString.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateViaIdentityIotconnectorExpanded.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateViaIdentityWorkspaceExpanded.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateViaJsonFilePath.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateViaJsonString.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnector_CreateViaIdentityWorkspaceExpanded.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnector_CreateViaJsonFilePath.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnector_CreateViaJsonString.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaIdentityWorkspaceExpanded.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonFilePath.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonString.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareDicomService_DeleteViaIdentityDicomservice.cs rename generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/{RemoveAzHealthcarePrivateEndpointConnection_DeleteViaIdentity.cs => RemoveAzHealthcareFhirService_DeleteViaIdentityFhirservice.cs} (79%) create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentityIotconnector.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentityWorkspace.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnector_DeleteViaIdentityIotconnector.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentityWorkspace.cs rename generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/{TestAzHealthcareServiceNameAvailability_CheckViaIdentity.cs => TestAzHealthcareServiceNameAvailability_CheckViaJsonFilePath.cs} (77%) rename generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/{TestAzHealthcareServiceNameAvailability_CheckViaIdentityExpanded.cs => TestAzHealthcareServiceNameAvailability_CheckViaJsonString.cs} (78%) create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisService_UpdateViaJsonFilePath.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisService_UpdateViaJsonString.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisWorkspace_UpdateViaJsonFilePath.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisWorkspace_UpdateViaJsonString.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareDicomService_UpdateViaIdentityWorkspaceExpanded.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareFhirService_UpdateViaIdentityWorkspaceExpanded.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnectorFhirDestination_UpdateExpanded.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityExpanded.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityIotconnectorExpanded.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityWorkspaceExpanded.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnector_UpdateViaIdentityWorkspaceExpanded.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateExpanded.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityExpanded.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityWorkspaceExpanded.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Context.cs create mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/InputHandler.cs delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcarePrivateEndpointConnection.ps1 delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcarePrivateLinkResource.ps1 delete mode 100644 generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcarePrivateEndpointConnection.ps1 rename generated/HealthcareApis/HealthcareApis.Autorest/internal/{Remove-AzHealthcarePrivateEndpointConnection.ps1 => Update-AzHealthcareWorkspacePrivateEndpointConnection.ps1} (61%) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/Az.HealthcareApis.format.ps1xml b/generated/HealthcareApis/HealthcareApis.Autorest/Az.HealthcareApis.format.ps1xml index 61235dfdf19b..ad556c90ccf4 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/Az.HealthcareApis.format.ps1xml +++ b/generated/HealthcareApis/HealthcareApis.Autorest/Az.HealthcareApis.format.ps1xml @@ -2,97 +2,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.HealthcareApisIdentity - - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.HealthcareApisIdentity - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DicomServiceName - - - FhirDestinationName - - - FhirServiceName - - - GroupName - - - IotConnectorName - - - LocationName - - - OperationResultId - - - PrivateEndpointConnectionName - - - ResourceGroupName - - - ResourceName - - - SubscriptionId - - - WorkspaceName - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.CheckNameAvailabilityParameters + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.CheckNameAvailabilityParameters - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.CheckNameAvailabilityParameters + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.CheckNameAvailabilityParameters#Multiple @@ -112,9 +24,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomService + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomService - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomService + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomService#Multiple @@ -146,15 +58,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceAuthenticationConfiguration + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceAuthenticationConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceAuthenticationConfiguration + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceAuthenticationConfiguration#Multiple - - - @@ -162,9 +71,6 @@ - - Audience - Authority @@ -174,9 +80,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceCollection + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceCollection - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceCollection + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceCollection#Multiple @@ -196,9 +102,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServicePatchResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServicePatchResource - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServicePatchResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServicePatchResource#Multiple @@ -230,9 +136,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceProperties + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceProperties - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceProperties + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceProperties#Multiple @@ -264,9 +170,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirService + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirService - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirService + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirService#Multiple @@ -304,9 +210,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAccessPolicyEntry + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAccessPolicyEntry - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAccessPolicyEntry + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAccessPolicyEntry#Multiple @@ -326,31 +232,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAcrConfiguration - - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAcrConfiguration - - - - - - - - - - - - LoginServer - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAuthenticationConfiguration + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAuthenticationConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAuthenticationConfiguration + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAuthenticationConfiguration#Multiple @@ -382,9 +266,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceCollection + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceCollection - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceCollection + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceCollection#Multiple @@ -404,27 +288,18 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceCorsConfiguration + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceCorsConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceCorsConfiguration + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceCorsConfiguration#Multiple - - - - - - - - - @@ -432,27 +307,18 @@ AllowCredentials - - Header - MaxAge - - Method - - - Origin - - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceExportConfiguration + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceExportConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceExportConfiguration + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceExportConfiguration#Multiple @@ -472,9 +338,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServicePatchResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServicePatchResource - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServicePatchResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServicePatchResource#Multiple @@ -506,9 +372,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceProperties + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceProperties - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceProperties + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceProperties#Multiple @@ -540,9 +406,97 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.InternalErrorDetails + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.HealthcareApisIdentity + + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.HealthcareApisIdentity#Multiple + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DicomServiceName + + + FhirDestinationName + + + FhirServiceName + + + GroupName + + + IotConnectorName + + + LocationName + + + OperationResultId + + + PrivateEndpointConnectionName + + + ResourceGroupName + + + ResourceName + + + SubscriptionId + + + WorkspaceName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.InternalErrorDetails - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.InternalErrorDetails + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.InternalErrorDetails#Multiple @@ -574,9 +528,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnector + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnector - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnector + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnector#Multiple @@ -608,9 +562,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnectorCollection + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnectorCollection - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnectorCollection + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnectorCollection#Multiple @@ -630,9 +584,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnectorPatchResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnectorPatchResource - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnectorPatchResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnectorPatchResource#Multiple @@ -664,9 +618,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnectorProperties + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnectorProperties - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnectorProperties + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnectorProperties#Multiple @@ -686,9 +640,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotDestinationProperties + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotDestinationProperties - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotDestinationProperties + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotDestinationProperties#Multiple @@ -708,9 +662,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotEventHubIngestionEndpointConfiguration + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotEventHubIngestionEndpointConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotEventHubIngestionEndpointConfiguration + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotEventHubIngestionEndpointConfiguration#Multiple @@ -742,9 +696,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotFhirDestination + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestination - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotFhirDestination + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestination#Multiple @@ -776,9 +730,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotFhirDestinationCollection + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestinationCollection - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotFhirDestinationCollection + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestinationCollection#Multiple @@ -798,9 +752,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotFhirDestinationProperties + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestinationProperties - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotFhirDestinationProperties + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestinationProperties#Multiple @@ -832,9 +786,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ListOperations + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ListOperations - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ListOperations + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ListOperations#Multiple @@ -854,9 +808,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.LocationBasedResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.LocationBasedResource - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.LocationBasedResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.LocationBasedResource#Multiple @@ -888,9 +842,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.LogSpecification + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.LogSpecification - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.LogSpecification + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.LogSpecification#Multiple @@ -922,9 +876,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.MetricDimension + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.MetricDimension - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.MetricDimension + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.MetricDimension#Multiple @@ -956,9 +910,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.MetricSpecification + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.MetricSpecification - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.MetricSpecification + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.MetricSpecification#Multiple @@ -983,12 +937,6 @@ - - - - - - @@ -1017,12 +965,6 @@ SourceMdmNamespace - - SupportedAggregationType - - - SupportedTimeGrainType - Unit @@ -1032,9 +974,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationDetail + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationDetail - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationDetail + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationDetail#Multiple @@ -1072,9 +1014,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationDisplay - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationDisplay#Multiple @@ -1112,9 +1054,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationResultsDescription + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationResultsDescription - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationResultsDescription + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationResultsDescription#Multiple @@ -1158,9 +1100,31 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateEndpointConnectionDescription + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnection + + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnection#Multiple + + + + + + + + + + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionDescription - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateEndpointConnectionDescription + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionDescription#Multiple @@ -1216,42 +1180,74 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateLinkResourceDescription + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionProperties - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateLinkResourceDescription + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionProperties#Multiple - - - - - - - - - - - - - + - GroupId + ProvisioningState + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResource + + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResource#Multiple + + + + + + + + + + Name + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourceDescription + + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourceDescription#Multiple + + + + + + + + + + + + + + + + - RequiredMember + GroupId - RequiredZoneName + Name ResourceGroupName @@ -1262,27 +1258,55 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceCore + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourceProperties - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceCore + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourceProperties#Multiple - + + + + + + + GroupId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkServiceConnectionState + + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkServiceConnectionState#Multiple + + + - + + + + + + + - Etag + ActionsRequired - Name + Description + + + Status @@ -1290,21 +1314,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTags + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Resource - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTags + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Resource#Multiple - + - Item + Name @@ -1312,21 +1336,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfiguration + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceCore - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfiguration + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceCore#Multiple - + + + + - Default + Etag + + + Name @@ -1334,9 +1364,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfigurationResourceTypeOverrides + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTags - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfigurationResourceTypeOverrides + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTags#Multiple @@ -1356,21 +1386,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAccessPolicyEntry + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAccessPolicyEntry + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfiguration#Multiple - + - ObjectId + Default @@ -1378,21 +1408,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAcrConfigurationInfo + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfigurationResourceTypeOverrides - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAcrConfigurationInfo + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfigurationResourceTypeOverrides#Multiple - + - LoginServer + Item @@ -1400,9 +1430,31 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAuthenticationConfigurationInfo + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAccessPolicyEntry - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAuthenticationConfigurationInfo + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAccessPolicyEntry#Multiple + + + + + + + + + + + + ObjectId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAuthenticationConfigurationInfo + + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAuthenticationConfigurationInfo#Multiple @@ -1434,27 +1486,18 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceCorsConfigurationInfo + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceCorsConfigurationInfo - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceCorsConfigurationInfo + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceCorsConfigurationInfo#Multiple - - - - - - - - - @@ -1462,27 +1505,18 @@ AllowCredentials - - Header - MaxAge - - Method - - - Origin - - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceCosmosDbConfigurationInfo + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceCosmosDbConfigurationInfo - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceCosmosDbConfigurationInfo + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceCosmosDbConfigurationInfo#Multiple @@ -1508,9 +1542,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceExportConfigurationInfo + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceExportConfigurationInfo - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceExportConfigurationInfo + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceExportConfigurationInfo#Multiple @@ -1530,9 +1564,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGenerated + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1 - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGenerated + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1#Multiple @@ -1558,9 +1592,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceOciArtifactEntry + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceOciArtifactEntry - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceOciArtifactEntry + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceOciArtifactEntry#Multiple @@ -1592,9 +1626,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesDescription + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesDescription - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesDescription + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesDescription#Multiple @@ -1632,9 +1666,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesDescriptionListResult + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesDescriptionListResult - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesDescriptionListResult + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesDescriptionListResult#Multiple @@ -1654,9 +1688,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesNameAvailabilityInfo + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesNameAvailabilityInfo - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesNameAvailabilityInfo + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesNameAvailabilityInfo#Multiple @@ -1688,9 +1722,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesPatchDescriptionTags + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesPatchDescriptionTags - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesPatchDescriptionTags + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesPatchDescriptionTags#Multiple @@ -1710,9 +1744,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesProperties + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesProperties - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesProperties + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesProperties#Multiple @@ -1738,9 +1772,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesPropertiesUpdateParameters + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesPropertiesUpdateParameters - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesPropertiesUpdateParameters + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesPropertiesUpdateParameters#Multiple @@ -1760,9 +1794,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResource - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResource#Multiple @@ -1800,9 +1834,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResourceIdentity + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResourceIdentity - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResourceIdentity + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResourceIdentity#Multiple @@ -1828,9 +1862,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResourceTags + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResourceTags - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResourceTags + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResourceTags#Multiple @@ -1850,117 +1884,51 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.TaggedResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.TaggedResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData#Multiple - + - + - + - - - - - - Etag - - - Location - - - Name - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentity - - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentity - - - - + - + + + + - ClientId + CreatedAt - PrincipalId + CreatedBy - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.Workspace - - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.Workspace - - - - - - - - - - - - - - - - - Location + CreatedByType - Name + LastModifiedAt - ResourceGroupName + LastModifiedBy - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.WorkspaceList - - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.WorkspaceList - - - - - - - - - - - NextLink + LastModifiedByType @@ -1968,40 +1936,18 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.WorkspaceProperties + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.TaggedResource - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.WorkspaceProperties + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.TaggedResource#Multiple - + - + - - - - - - ProvisioningState - - - PublicNetworkAccess - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnection - - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnection - - - @@ -2010,49 +1956,11 @@ - Name + Etag - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionProperties - - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionProperties - - - - - - - - - - - ProvisioningState + Location - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkResource - - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkResource - - - - - - - - - - Name @@ -2062,33 +1970,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkResourceProperties + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentity - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkResourceProperties + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentity#Multiple - - - - + - + - GroupId - - - RequiredMember + ClientId - RequiredZoneName + PrincipalId @@ -2096,33 +1998,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Workspace - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Workspace#Multiple - + - + - + - ActionsRequired + Location - Description + Name - Status + ResourceGroupName @@ -2130,21 +2032,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.Resource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.WorkspaceList - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.Resource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.WorkspaceList#Multiple - + - Name + NextLink @@ -2152,51 +2054,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.WorkspaceProperties - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.WorkspaceProperties#Multiple - - - - - - - - - - - - - + - + - CreatedAt - - - CreatedBy - - - CreatedByType - - - LastModifiedAt - - - LastModifiedBy + ProvisioningState - LastModifiedByType + PublicNetworkAccess diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/Az.HealthcareApis.psd1 b/generated/HealthcareApis/HealthcareApis.Autorest/Az.HealthcareApis.psd1 index 1b32cb3f1c7b..2f9814ddec5b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/Az.HealthcareApis.psd1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/Az.HealthcareApis.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.HealthcareApis.private.dll' FormatsToProcess = './Az.HealthcareApis.format.ps1xml' - FunctionsToExport = 'Get-AzHealthcareApisService', 'Get-AzHealthcareApisWorkspace', 'Get-AzHealthcareDicomService', 'Get-AzHealthcareFhirDestination', 'Get-AzHealthcareFhirService', 'Get-AzHealthcareIotConnector', 'Get-AzHealthcareIotConnectorFhirDestination', 'New-AzHealthcareApisService', 'New-AzHealthcareApisWorkspace', 'New-AzHealthcareDicomService', 'New-AzHealthcareFhirService', 'New-AzHealthcareIotConnector', 'New-AzHealthcareIotConnectorFhirDestination', 'Remove-AzHealthcareApisService', 'Remove-AzHealthcareApisWorkspace', 'Remove-AzHealthcareDicomService', 'Remove-AzHealthcareFhirService', 'Remove-AzHealthcareIotConnector', 'Remove-AzHealthcareIotConnectorFhirDestination', 'Test-AzHealthcareServiceNameAvailability', 'Update-AzHealthcareApisService', 'Update-AzHealthcareApisWorkspace', 'Update-AzHealthcareDicomService', 'Update-AzHealthcareFhirService', 'Update-AzHealthcareIotConnector', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzHealthcareApisService', 'Get-AzHealthcareApisWorkspace', 'Get-AzHealthcareDicomService', 'Get-AzHealthcareFhirDestination', 'Get-AzHealthcareFhirService', 'Get-AzHealthcareIotConnector', 'Get-AzHealthcareIotConnectorFhirDestination', 'New-AzHealthcareApisService', 'New-AzHealthcareApisWorkspace', 'New-AzHealthcareDicomService', 'New-AzHealthcareFhirService', 'New-AzHealthcareIotConnector', 'New-AzHealthcareIotConnectorFhirDestination', 'Remove-AzHealthcareApisService', 'Remove-AzHealthcareApisWorkspace', 'Remove-AzHealthcareDicomService', 'Remove-AzHealthcareFhirService', 'Remove-AzHealthcareIotConnector', 'Remove-AzHealthcareIotConnectorFhirDestination', 'Test-AzHealthcareServiceNameAvailability', 'Update-AzHealthcareApisService', 'Update-AzHealthcareApisWorkspace', 'Update-AzHealthcareDicomService', 'Update-AzHealthcareFhirService', 'Update-AzHealthcareIotConnector', 'Update-AzHealthcareIotConnectorFhirDestination' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'HealthcareApis', 'HealthCare', 'FhirService' diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/Properties/AssemblyInfo.cs b/generated/HealthcareApis/HealthcareApis.Autorest/Properties/AssemblyInfo.cs index add03005efaa..91d48d6b0592 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/Properties/AssemblyInfo.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/Properties/AssemblyInfo.cs @@ -20,7 +20,7 @@ [assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] [assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] [assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - HealthcareApis")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("2.1.0")] -[assembly: System.Reflection.AssemblyVersionAttribute("2.1.0")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("2.1.1")] +[assembly: System.Reflection.AssemblyVersionAttribute("2.1.1")] [assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] [assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/check-dependencies.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/check-dependencies.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/check-dependencies.ps1 @@ -12,13 +12,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- -param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) +param([switch]$NotIsolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) $ErrorActionPreference = 'Stop' -if(-not $Isolated) { +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path - & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareApisService.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareApisService.ps1 index 28ec00db4e2b..20797ef4eb2c 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareApisService.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareApisService.ps1 @@ -29,7 +29,7 @@ Get-AzHealthcareApisService -ResourceGroupName azps_test_group -Name azpsapiserv .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription .Notes COMPLEX PARAMETER PROPERTIES @@ -53,7 +53,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareapisservice #> function Get-AzHealthcareApisService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -82,7 +82,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -141,6 +140,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -165,9 +173,7 @@ begin { List = 'Az.HealthcareApis.private\Get-AzHealthcareApisService_List'; List1 = 'Az.HealthcareApis.private\Get-AzHealthcareApisService_List1'; } - if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -181,6 +187,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareApisWorkspace.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareApisWorkspace.ps1 index 5b46a8b1209f..86fe1916954b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareApisWorkspace.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareApisWorkspace.ps1 @@ -29,7 +29,7 @@ Get-AzHealthcareApisWorkspace -ResourceGroupName azps_test_group .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace .Notes COMPLEX PARAMETER PROPERTIES @@ -53,7 +53,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareapisworkspace #> function Get-AzHealthcareApisWorkspace { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -83,7 +83,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -142,6 +141,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -166,9 +174,7 @@ begin { List = 'Az.HealthcareApis.private\Get-AzHealthcareApisWorkspace_List'; List1 = 'Az.HealthcareApis.private\Get-AzHealthcareApisWorkspace_List1'; } - if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -182,6 +188,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareDicomService.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareDicomService.ps1 index 5063356832ce..3605d4ce1dd4 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareDicomService.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareDicomService.ps1 @@ -27,7 +27,7 @@ Get-AzHealthcareDicomService -Name azpsdicom -ResourceGroupName azps_test_group .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService .Notes COMPLEX PARAMETER PROPERTIES @@ -47,14 +47,30 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcaredicomservice #> function Get-AzHealthcareDicomService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory)] [Alias('DicomServiceName')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] @@ -87,9 +103,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -146,6 +167,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -167,11 +197,10 @@ begin { $mapping = @{ Get = 'Az.HealthcareApis.private\Get-AzHealthcareDicomService_Get'; GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcareDicomService_GetViaIdentity'; + GetViaIdentityWorkspace = 'Az.HealthcareApis.private\Get-AzHealthcareDicomService_GetViaIdentityWorkspace'; List = 'Az.HealthcareApis.private\Get-AzHealthcareDicomService_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -185,6 +214,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareFhirDestination.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareFhirDestination.ps1 index 8afbb5fb9499..7e3574d5fa79 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareFhirDestination.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareFhirDestination.ps1 @@ -23,12 +23,12 @@ Lists all FHIR destinations for the given IoT Connector Get-AzHealthcareFhirDestination -IotConnectorName azpsiotconnector -ResourceGroupName azps_test_group -WorkspaceName azpshcws .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcarefhirdestination #> function Get-AzHealthcareFhirDestination { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -112,6 +112,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -133,9 +142,7 @@ begin { $mapping = @{ List = 'Az.HealthcareApis.private\Get-AzHealthcareFhirDestination_List'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -149,6 +156,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareFhirService.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareFhirService.ps1 index 9869dbf51e84..7688f008992b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareFhirService.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareFhirService.ps1 @@ -27,7 +27,7 @@ Get-AzHealthcareFhirService -Name azpsfhirservice -ResourceGroupName azps_test_g .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService .Notes COMPLEX PARAMETER PROPERTIES @@ -47,14 +47,30 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcarefhirservice #> function Get-AzHealthcareFhirService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory)] [Alias('FhirServiceName')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] @@ -87,9 +103,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -146,6 +167,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -167,11 +197,10 @@ begin { $mapping = @{ Get = 'Az.HealthcareApis.private\Get-AzHealthcareFhirService_Get'; GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcareFhirService_GetViaIdentity'; + GetViaIdentityWorkspace = 'Az.HealthcareApis.private\Get-AzHealthcareFhirService_GetViaIdentityWorkspace'; List = 'Az.HealthcareApis.private\Get-AzHealthcareFhirService_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -185,6 +214,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareIotConnector.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareIotConnector.ps1 index ef91e0cd1d0b..9cab8efcf09b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareIotConnector.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareIotConnector.ps1 @@ -27,7 +27,7 @@ Get-AzHealthcareIotConnector -Name azpsiotconnector -ResourceGroupName azps_test .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector .Notes COMPLEX PARAMETER PROPERTIES @@ -47,14 +47,30 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareiotconnector #> function Get-AzHealthcareIotConnector { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory)] [Alias('IotConnectorName')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] @@ -87,9 +103,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -146,6 +167,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -167,11 +197,10 @@ begin { $mapping = @{ Get = 'Az.HealthcareApis.private\Get-AzHealthcareIotConnector_Get'; GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcareIotConnector_GetViaIdentity'; + GetViaIdentityWorkspace = 'Az.HealthcareApis.private\Get-AzHealthcareIotConnector_GetViaIdentityWorkspace'; List = 'Az.HealthcareApis.private\Get-AzHealthcareIotConnector_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -185,6 +214,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareIotConnectorFhirDestination.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareIotConnectorFhirDestination.ps1 index 8b9a6c19f908..957077a10598 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareIotConnectorFhirDestination.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Get-AzHealthcareIotConnectorFhirDestination.ps1 @@ -25,7 +25,7 @@ Get-AzHealthcareIotConnectorFhirDestination -FhirDestinationName azpsfhirdestina .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination .Notes COMPLEX PARAMETER PROPERTIES @@ -45,20 +45,53 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +IOTCONNECTORINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareiotconnectorfhirdestination #> function Get-AzHealthcareIotConnectorFhirDestination { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityIotconnector', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of IoT Connector FHIR destination resource. ${FhirDestinationName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of IoT Connector resource. @@ -87,9 +120,20 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityIotconnector', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${IotconnectorInputObject}, + + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -146,6 +190,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -167,10 +220,10 @@ begin { $mapping = @{ Get = 'Az.HealthcareApis.private\Get-AzHealthcareIotConnectorFhirDestination_Get'; GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcareIotConnectorFhirDestination_GetViaIdentity'; + GetViaIdentityIotconnector = 'Az.HealthcareApis.private\Get-AzHealthcareIotConnectorFhirDestination_GetViaIdentityIotconnector'; + GetViaIdentityWorkspace = 'Az.HealthcareApis.private\Get-AzHealthcareIotConnectorFhirDestination_GetViaIdentityWorkspace'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -184,6 +237,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareApisService.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareApisService.ps1 index 5235f3607346..3b7ec511bd93 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareApisService.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareApisService.ps1 @@ -23,7 +23,7 @@ Create or update the metadata of a service instance. New-AzHealthcareApisService -ResourceGroupName azps_test_group -Name azpsapiservice -Kind 'fhir' -Location eastus2 -CosmosOfferThroughput 400 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription .Notes COMPLEX PARAMETER PROPERTIES @@ -40,12 +40,12 @@ ACRCONFIGURATIONOCIARTIFACT : The list of Open Conta PRIVATEENDPOINTCONNECTION : The list of private endpoint connections that are set up for this resource. [PrivateLinkServiceConnectionStateActionsRequired ]: A message indicating if changes on the service provider require any updates on the consumer. [PrivateLinkServiceConnectionStateDescription ]: The reason for approval/rejection of the connection. - [PrivateLinkServiceConnectionStateStatus ]: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + [PrivateLinkServiceConnectionStateStatus ]: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareapisservice #> function New-AzHealthcareApisService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -67,152 +67,161 @@ param( # The subscription identifier. ${SubscriptionId}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind])] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir", "fhir-Stu3", "fhir-R4")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind] + [System.String] # The kind of the service. ${Kind}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Int32] # The provisioned throughput for the backing database. ${CosmosOfferThroughput}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry[]] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntry[]] # The access policies of the service instance. - # To construct, see NOTES section for ACCESSPOLICYOBJECTID properties and create a hash table. ${AccessPolicyObjectId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The list of the ACR login servers. ${AcrConfigurationLoginServer}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[]] # The list of Open Container Initiative (OCI) artifacts. - # To construct, see NOTES section for ACRCONFIGURATIONOCIARTIFACT properties and create a hash table. ${AcrConfigurationOciArtifact}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Management.Automation.SwitchParameter] # If credentials are allowed via CORS. ${AllowCorsCredential}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The audience url for the service ${Audience}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The authority url for the service ${Authority}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The headers to be allowed via CORS. ${CorsHeader}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Int32] # The max age to be allowed via CORS. ${CorsMaxAge}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The methods to be allowed via CORS. ${CorsMethod}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The origins to be allowed via CORS. ${CorsOrigin}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The URI of the customer-managed key for the backing database. ${CosmosKeyVaultKeyUri}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Management.Automation.SwitchParameter] # If the SMART on FHIR proxy is enabled ${EnableSmartProxy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The name of the default export storage account. ${ExportStorageAccountName}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection[]] # The list of private endpoint connections that are set up for this resource. - # To construct, see NOTES section for PRIVATEENDPOINTCONNECTION properties and create a hash table. ${PrivateEndpointConnection}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess] + [System.String] # Control permission for data plane traffic coming from public networks while private endpoint is enabled. ${PublicNetworkAccess}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags]))] [System.Collections.Hashtable] # The resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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()] @@ -274,6 +283,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -294,10 +312,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareApisService'; + CreateViaJsonFilePath = 'Az.HealthcareApis.custom\New-AzHealthcareApisService'; + CreateViaJsonString = 'Az.HealthcareApis.custom\New-AzHealthcareApisService'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -311,6 +329,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareApisWorkspace.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareApisWorkspace.ps1 index 00831a2056f0..fd9ff4792490 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareApisWorkspace.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareApisWorkspace.ps1 @@ -23,12 +23,12 @@ Creates or updates a workspace resource with the specified parameters. New-AzHealthcareApisWorkspace -Name azpshcws -ResourceGroupName azps_test_group -Location eastus2 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareapisworkspace #> function New-AzHealthcareApisWorkspace { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -51,38 +51,51 @@ param( # The subscription identifier. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess] + [System.String] # Control permission for data plane traffic coming from public networks while private endpoint is enabled. ${PublicNetworkAccess}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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()] @@ -144,6 +157,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -164,10 +186,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareApisWorkspace'; + CreateViaJsonFilePath = 'Az.HealthcareApis.custom\New-AzHealthcareApisWorkspace'; + CreateViaJsonString = 'Az.HealthcareApis.custom\New-AzHealthcareApisWorkspace'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -181,6 +203,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareDicomService.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareDicomService.ps1 index 239b48357fe5..71fa60ed1d7d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareDicomService.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareDicomService.ps1 @@ -22,13 +22,34 @@ Creates or updates a DICOM Service resource with the specified parameters. .Example New-AzHealthcareDicomService -Name azpsdicom -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Location eastus2 +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService +.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. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcaredicomservice #> function New-AzHealthcareDicomService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -38,73 +59,102 @@ param( # The name of DICOM Service resource. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. ${WorkspaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonString')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The subscription identifier. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities]))] - [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess] + [System.String] # Control permission for data plane traffic coming from public networks while private endpoint is enabled. ${PublicNetworkAccess}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,6 +216,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -186,10 +245,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareDicomService'; + CreateViaJsonString = 'Az.HealthcareApis.custom\New-AzHealthcareDicomService'; + CreateViaJsonFilePath = 'Az.HealthcareApis.custom\New-AzHealthcareDicomService'; + CreateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareDicomService'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonString', 'CreateViaJsonFilePath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -203,6 +263,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareFhirService.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareFhirService.ps1 index 6d593cead89f..f0c66fae7340 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareFhirService.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareFhirService.ps1 @@ -22,8 +22,10 @@ Creates or updates a FHIR Service resource with the specified parameters. .Example New-AzHealthcareFhirService -Name azpsfhirservice -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Location eastus2 -Kind 'fhir-R4' -Authority "https://login.microsoftonline.com/{DirectoryID}" -Audience "https://azpshcws-{FhirServiceName}.fhir.azurehealthcareapis.com" +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService .Notes COMPLEX PARAMETER PROPERTIES @@ -36,11 +38,26 @@ ACRCONFIGURATIONOCIARTIFACT : The list of Open Conta [Digest ]: The artifact digest. [ImageName ]: The artifact name. [LoginServer ]: The Azure Container Registry login server. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcarefhirservice #> function New-AzHealthcareFhirService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -50,174 +67,216 @@ param( # The name of FHIR Service resource. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. ${WorkspaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonString')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The subscription identifier. ${SubscriptionId}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind])] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir-Stu3", "fhir-R4")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind] + [System.String] # The kind of the service. ${Kind}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry[]] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry[]] # Fhir Service access policies. - # To construct, see NOTES section for ACCESSPOLICYOBJECTID properties and create a hash table. ${AccessPolicyObjectId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The list of the Azure container registry login servers. ${AcrConfigurationLoginServer}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[]] # The list of Open Container Initiative (OCI) artifacts. - # To construct, see NOTES section for ACRCONFIGURATIONOCIARTIFACT properties and create a hash table. ${AcrConfigurationOciArtifact}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Management.Automation.SwitchParameter] # If credentials are allowed via CORS. ${AllowCorsCredential}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The audience url for the service ${Audience}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The authority url for the service ${Authority}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The headers to be allowed via CORS. ${CorsHeader}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Int32] # The max age to be allowed via CORS. ${CorsMaxAge}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The methods to be allowed via CORS. ${CorsMethod}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The origins to be allowed via CORS. ${CorsOrigin}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Management.Automation.SwitchParameter] # If the SMART on FHIR proxy is enabled ${EnableSmartProxy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The name of the default export storage account. ${ExportStorageAccountName}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities]))] - [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess] + [System.String] # Control permission for data plane traffic coming from public networks while private endpoint is enabled. ${PublicNetworkAccess}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("no-version", "versioned", "versioned-update")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy] + [System.String] # The default value for tracking history across all resources. ${ResourceVersionPolicyConfigurationDefault}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides]))] [System.Collections.Hashtable] # A list of FHIR Resources and their version policy overrides. ${ResourceVersionPolicyConfigurationResourceTypeOverride}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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()] @@ -279,6 +338,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -299,10 +367,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareFhirService'; + CreateViaJsonString = 'Az.HealthcareApis.custom\New-AzHealthcareFhirService'; + CreateViaJsonFilePath = 'Az.HealthcareApis.custom\New-AzHealthcareFhirService'; + CreateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareFhirService'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonString', 'CreateViaJsonFilePath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -316,6 +385,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareIotConnector.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareIotConnector.ps1 index f68cfeadcf83..203055fe7c86 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareIotConnector.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareIotConnector.ps1 @@ -23,13 +23,34 @@ Creates or updates an IoT Connector resource with the specified parameters. $arr = @() New-AzHealthcareIotConnector -Name azpsiotconnector -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Location eastus2 -IngestionEndpointConfigurationConsumerGroup "sajob-01-portal_input-01_consumer_group" -IngestionEndpointConfigurationEventHubName "sajob01portaleventhub" -IngestionEndpointConfigurationFullyQualifiedEventHubNamespace "sdk-Namespace-4761.servicebus.windows.net" -DeviceMappingContent @{"templateType"="CollectionContent";"template"=$arr} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector +.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. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareiotconnector #> function New-AzHealthcareIotConnector { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -39,91 +60,123 @@ param( # The name of IoT Connector resource. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. ${WorkspaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonString')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The subscription identifier. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent]))] [System.Collections.Hashtable] # The mapping. ${DeviceMappingContent}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # Consumer group of the event hub to connected to. ${IngestionEndpointConfigurationConsumerGroup}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # Event Hub name to connect to. ${IngestionEndpointConfigurationEventHubName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # Fully qualified namespace of the Event Hub to connect to. ${IngestionEndpointConfigurationFullyQualifiedEventHubNamespace}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities]))] - [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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()] @@ -185,6 +238,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -205,10 +267,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareIotConnector'; + CreateViaJsonString = 'Az.HealthcareApis.custom\New-AzHealthcareIotConnector'; + CreateViaJsonFilePath = 'Az.HealthcareApis.custom\New-AzHealthcareIotConnector'; + CreateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareIotConnector'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonString', 'CreateViaJsonFilePath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -222,6 +285,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareIotConnectorFhirDestination.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareIotConnectorFhirDestination.ps1 index 2ee9dbdac2f6..8c023c1e65fe 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareIotConnectorFhirDestination.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/New-AzHealthcareIotConnectorFhirDestination.ps1 @@ -23,13 +23,49 @@ Creates or updates an IoT Connector FHIR destination resource with the specified $arr = @() New-AzHealthcareIotConnectorFhirDestination -FhirDestinationName azpsfhirdestination -IotConnectorName azpsiotconnector -ResourceGroupName azps_test_group -WorkspaceName azpshcws -FhirServiceResourceId "/subscriptions/{SubscriptionId}/resourceGroups/azps_test_group/providers/Microsoft.HealthcareApis/workspaces/azpshcws/fhirservices/azpsfhirservice" -ResourceIdentityResolutionType 'Create' -Location eastus2 -FhirMappingContent @{"templateType"="CollectionFhirTemplate";"template"=$arr} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination +.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. + +IOTCONNECTORINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareiotconnectorfhirdestination #> function New-AzHealthcareIotConnectorFhirDestination { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -38,69 +74,113 @@ param( # The name of IoT Connector FHIR destination resource. ${FhirDestinationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of IoT Connector resource. ${IotConnectorName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. ${WorkspaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonString')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The subscription identifier. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${IotconnectorInputObject}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # Fully qualified resource id of the FHIR service to connect to. ${FhirServiceResourceId}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType])] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Create", "Lookup")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType] + [System.String] # Determines how resource identity is resolved on the destination. ${ResourceIdentityResolutionType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent]))] [System.Collections.Hashtable] # The mapping. ${FhirMappingContent}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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()] @@ -162,6 +242,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -182,10 +271,12 @@ begin { $mapping = @{ CreateExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareIotConnectorFhirDestination'; + CreateViaJsonString = 'Az.HealthcareApis.custom\New-AzHealthcareIotConnectorFhirDestination'; + CreateViaJsonFilePath = 'Az.HealthcareApis.custom\New-AzHealthcareIotConnectorFhirDestination'; + CreateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareIotConnectorFhirDestination'; + CreateViaIdentityIotconnectorExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareIotConnectorFhirDestination'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonString', 'CreateViaJsonFilePath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -199,6 +290,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/ProxyCmdletDefinitions.ps1 index 0ca0011100dd..7ffaeeddc928 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -29,7 +29,7 @@ Get-AzHealthcareApisService -ResourceGroupName azps_test_group -Name azpsapiserv .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription .Notes COMPLEX PARAMETER PROPERTIES @@ -53,7 +53,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareapisservice #> function Get-AzHealthcareApisService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -82,7 +82,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -141,6 +140,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -165,9 +173,7 @@ begin { List = 'Az.HealthcareApis.private\Get-AzHealthcareApisService_List'; List1 = 'Az.HealthcareApis.private\Get-AzHealthcareApisService_List1'; } - if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -181,6 +187,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -239,7 +248,7 @@ Get-AzHealthcareApisWorkspace -ResourceGroupName azps_test_group .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace .Notes COMPLEX PARAMETER PROPERTIES @@ -263,7 +272,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareapisworkspace #> function Get-AzHealthcareApisWorkspace { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -293,7 +302,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -352,6 +360,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -376,9 +393,7 @@ begin { List = 'Az.HealthcareApis.private\Get-AzHealthcareApisWorkspace_List'; List1 = 'Az.HealthcareApis.private\Get-AzHealthcareApisWorkspace_List1'; } - if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -392,6 +407,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -448,7 +466,7 @@ Get-AzHealthcareDicomService -Name azpsdicom -ResourceGroupName azps_test_group .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService .Notes COMPLEX PARAMETER PROPERTIES @@ -468,14 +486,30 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcaredicomservice #> function Get-AzHealthcareDicomService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory)] [Alias('DicomServiceName')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] @@ -508,9 +542,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -567,6 +606,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -588,11 +636,10 @@ begin { $mapping = @{ Get = 'Az.HealthcareApis.private\Get-AzHealthcareDicomService_Get'; GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcareDicomService_GetViaIdentity'; + GetViaIdentityWorkspace = 'Az.HealthcareApis.private\Get-AzHealthcareDicomService_GetViaIdentityWorkspace'; List = 'Az.HealthcareApis.private\Get-AzHealthcareDicomService_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -606,6 +653,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -658,12 +708,12 @@ Lists all FHIR destinations for the given IoT Connector Get-AzHealthcareFhirDestination -IotConnectorName azpsiotconnector -ResourceGroupName azps_test_group -WorkspaceName azpshcws .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcarefhirdestination #> function Get-AzHealthcareFhirDestination { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -747,6 +797,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -768,9 +827,7 @@ begin { $mapping = @{ List = 'Az.HealthcareApis.private\Get-AzHealthcareFhirDestination_List'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -784,6 +841,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -840,7 +900,7 @@ Get-AzHealthcareFhirService -Name azpsfhirservice -ResourceGroupName azps_test_g .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService .Notes COMPLEX PARAMETER PROPERTIES @@ -860,14 +920,30 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcarefhirservice #> function Get-AzHealthcareFhirService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory)] [Alias('FhirServiceName')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] @@ -900,9 +976,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -959,6 +1040,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -980,11 +1070,10 @@ begin { $mapping = @{ Get = 'Az.HealthcareApis.private\Get-AzHealthcareFhirService_Get'; GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcareFhirService_GetViaIdentity'; + GetViaIdentityWorkspace = 'Az.HealthcareApis.private\Get-AzHealthcareFhirService_GetViaIdentityWorkspace'; List = 'Az.HealthcareApis.private\Get-AzHealthcareFhirService_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -998,6 +1087,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1052,7 +1144,7 @@ Get-AzHealthcareIotConnectorFhirDestination -FhirDestinationName azpsfhirdestina .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination .Notes COMPLEX PARAMETER PROPERTIES @@ -1072,20 +1164,53 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +IOTCONNECTORINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareiotconnectorfhirdestination #> function Get-AzHealthcareIotConnectorFhirDestination { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityIotconnector', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of IoT Connector FHIR destination resource. ${FhirDestinationName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of IoT Connector resource. @@ -1114,9 +1239,20 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityIotconnector', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${IotconnectorInputObject}, + + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1173,6 +1309,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1194,10 +1339,10 @@ begin { $mapping = @{ Get = 'Az.HealthcareApis.private\Get-AzHealthcareIotConnectorFhirDestination_Get'; GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcareIotConnectorFhirDestination_GetViaIdentity'; + GetViaIdentityIotconnector = 'Az.HealthcareApis.private\Get-AzHealthcareIotConnectorFhirDestination_GetViaIdentityIotconnector'; + GetViaIdentityWorkspace = 'Az.HealthcareApis.private\Get-AzHealthcareIotConnectorFhirDestination_GetViaIdentityWorkspace'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1211,6 +1356,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1267,7 +1415,7 @@ Get-AzHealthcareIotConnector -Name azpsiotconnector -ResourceGroupName azps_test .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector .Notes COMPLEX PARAMETER PROPERTIES @@ -1287,14 +1435,30 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareiotconnector #> function Get-AzHealthcareIotConnector { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory)] [Alias('IotConnectorName')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] @@ -1327,9 +1491,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1386,6 +1555,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1407,11 +1585,10 @@ begin { $mapping = @{ Get = 'Az.HealthcareApis.private\Get-AzHealthcareIotConnector_Get'; GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcareIotConnector_GetViaIdentity'; + GetViaIdentityWorkspace = 'Az.HealthcareApis.private\Get-AzHealthcareIotConnector_GetViaIdentityWorkspace'; List = 'Az.HealthcareApis.private\Get-AzHealthcareIotConnector_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1425,6 +1602,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1531,7 +1711,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1608,6 +1787,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1630,9 +1818,7 @@ begin { Delete = 'Az.HealthcareApis.private\Remove-AzHealthcareApisService_Delete'; DeleteViaIdentity = 'Az.HealthcareApis.private\Remove-AzHealthcareApisService_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1646,6 +1832,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1753,7 +1942,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1830,6 +2018,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1852,9 +2049,7 @@ begin { Delete = 'Az.HealthcareApis.private\Remove-AzHealthcareApisWorkspace_Delete'; DeleteViaIdentity = 'Az.HealthcareApis.private\Remove-AzHealthcareApisWorkspace_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1868,6 +2063,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1930,6 +2128,21 @@ 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. +DICOMSERVICEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. + INPUTOBJECT : Identity Parameter [DicomServiceName ]: The name of DICOM Service resource. [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. @@ -1972,6 +2185,7 @@ param( ${SubscriptionId}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityDicomservice', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. @@ -1981,9 +2195,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityDicomservice', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${DicomserviceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2058,6 +2277,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2079,10 +2307,9 @@ begin { $mapping = @{ Delete = 'Az.HealthcareApis.private\Remove-AzHealthcareDicomService_Delete'; DeleteViaIdentity = 'Az.HealthcareApis.private\Remove-AzHealthcareDicomService_DeleteViaIdentity'; + DeleteViaIdentityDicomservice = 'Az.HealthcareApis.private\Remove-AzHealthcareDicomService_DeleteViaIdentityDicomservice'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2096,6 +2323,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2158,6 +2388,21 @@ 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. +FHIRSERVICEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. + INPUTOBJECT : Identity Parameter [DicomServiceName ]: The name of DICOM Service resource. [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. @@ -2200,6 +2445,7 @@ param( ${SubscriptionId}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityFhirservice', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. @@ -2209,9 +2455,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityFhirservice', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${FhirserviceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2286,6 +2537,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2307,10 +2567,9 @@ begin { $mapping = @{ Delete = 'Az.HealthcareApis.private\Remove-AzHealthcareFhirService_Delete'; DeleteViaIdentity = 'Az.HealthcareApis.private\Remove-AzHealthcareFhirService_DeleteViaIdentity'; + DeleteViaIdentityFhirservice = 'Az.HealthcareApis.private\Remove-AzHealthcareFhirService_DeleteViaIdentityFhirservice'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2324,6 +2583,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2400,6 +2662,36 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +IOTCONNECTORINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/remove-azhealthcareiotconnectorfhirdestination #> @@ -2408,12 +2700,15 @@ function Remove-AzHealthcareIotConnectorFhirDestination { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityIotconnector', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityWorkspace', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of IoT Connector FHIR destination resource. ${FhirDestinationName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityWorkspace', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of IoT Connector resource. @@ -2442,9 +2737,20 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityIotconnector', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${IotconnectorInputObject}, + + [Parameter(ParameterSetName='DeleteViaIdentityWorkspace', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2519,6 +2825,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2540,10 +2855,10 @@ begin { $mapping = @{ Delete = 'Az.HealthcareApis.private\Remove-AzHealthcareIotConnectorFhirDestination_Delete'; DeleteViaIdentity = 'Az.HealthcareApis.private\Remove-AzHealthcareIotConnectorFhirDestination_DeleteViaIdentity'; + DeleteViaIdentityIotconnector = 'Az.HealthcareApis.private\Remove-AzHealthcareIotConnectorFhirDestination_DeleteViaIdentityIotconnector'; + DeleteViaIdentityWorkspace = 'Az.HealthcareApis.private\Remove-AzHealthcareIotConnectorFhirDestination_DeleteViaIdentityWorkspace'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2557,6 +2872,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2633,6 +2951,21 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +IOTCONNECTORINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/remove-azhealthcareiotconnector #> @@ -2661,6 +2994,7 @@ param( ${SubscriptionId}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityIotconnector', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. @@ -2670,9 +3004,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityIotconnector', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${IotconnectorInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2747,6 +3086,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2768,10 +3116,9 @@ begin { $mapping = @{ Delete = 'Az.HealthcareApis.private\Remove-AzHealthcareIotConnector_Delete'; DeleteViaIdentity = 'Az.HealthcareApis.private\Remove-AzHealthcareIotConnector_DeleteViaIdentity'; + DeleteViaIdentityIotconnector = 'Az.HealthcareApis.private\Remove-AzHealthcareIotConnector_DeleteViaIdentityIotconnector'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2785,6 +3132,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2837,11 +3187,9 @@ Check if a service instance name is available. Test-AzHealthcareServiceNameAvailability -Name azpsdicom -Type Microsoft.HealthcareApis/services .Inputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo .Notes COMPLEX PARAMETER PROPERTIES @@ -2850,66 +3198,50 @@ To create the parameters described below, construct a hash table containing the CHECKNAMEAVAILABILITYINPUT : Input values. Name : The name of the service instance to check. Type : The fully qualified resource type which includes provider namespace. - -INPUTOBJECT : Identity Parameter - [DicomServiceName ]: The name of DICOM Service resource. - [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. - [FhirServiceName ]: The name of FHIR Service resource. - [GroupName ]: The name of the private link resource group. - [Id ]: Resource identity path - [IotConnectorName ]: The name of IoT Connector resource. - [LocationName ]: The location of the operation. - [OperationResultId ]: The ID of the operation result to get. - [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource - [ResourceGroupName ]: The name of the resource group that contains the service instance. - [ResourceName ]: The name of the service instance. - [SubscriptionId ]: The subscription identifier. - [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/test-azhealthcareservicenameavailability #> function Test-AzHealthcareServiceNameAvailability { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo])] [CmdletBinding(DefaultParameterSetName='CheckExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Check')] - [Parameter(ParameterSetName='CheckExpanded')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The subscription identifier. ${SubscriptionId}, - [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='CheckViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - [Parameter(ParameterSetName='Check', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters] # Input values. - # To construct, see NOTES section for CHECKNAMEAVAILABILITYINPUT properties and create a hash table. ${CheckNameAvailabilityInput}, [Parameter(ParameterSetName='CheckExpanded', Mandatory)] - [Parameter(ParameterSetName='CheckViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The name of the service instance to check. ${Name}, [Parameter(ParameterSetName='CheckExpanded', Mandatory)] - [Parameter(ParameterSetName='CheckViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The fully qualified resource type which includes provider namespace. ${Type}, + [Parameter(ParameterSetName='CheckViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Check operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CheckViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Check operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2966,6 +3298,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2987,12 +3328,10 @@ begin { $mapping = @{ Check = 'Az.HealthcareApis.private\Test-AzHealthcareServiceNameAvailability_Check'; CheckExpanded = 'Az.HealthcareApis.private\Test-AzHealthcareServiceNameAvailability_CheckExpanded'; - CheckViaIdentity = 'Az.HealthcareApis.private\Test-AzHealthcareServiceNameAvailability_CheckViaIdentity'; - CheckViaIdentityExpanded = 'Az.HealthcareApis.private\Test-AzHealthcareServiceNameAvailability_CheckViaIdentityExpanded'; + CheckViaJsonFilePath = 'Az.HealthcareApis.private\Test-AzHealthcareServiceNameAvailability_CheckViaJsonFilePath'; + CheckViaJsonString = 'Az.HealthcareApis.private\Test-AzHealthcareServiceNameAvailability_CheckViaJsonString'; } - if (('Check', 'CheckExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Check', 'CheckExpanded', 'CheckViaJsonFilePath', 'CheckViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3006,6 +3345,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3062,7 +3404,7 @@ Get-AzHealthcareApisService -ResourceGroupName azps_test_group -Name azpsapiserv .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription .Notes COMPLEX PARAMETER PROPERTIES @@ -3086,22 +3428,28 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.healthcareapis/update-azhealthcareapisservice #> function Update-AzHealthcareApisService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the service instance. ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -3112,23 +3460,36 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess] + [System.String] # Control permission for data plane traffic coming from public networks while private endpoint is enabled. ${PublicNetworkAccess}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags]))] [System.Collections.Hashtable] # Instance tags ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3197,6 +3558,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3218,10 +3588,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareApisService_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareApisService_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.HealthcareApis.private\Update-AzHealthcareApisService_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.HealthcareApis.private\Update-AzHealthcareApisService_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3235,6 +3605,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3291,7 +3664,7 @@ Get-AzHealthcareApisWorkspace -Name azpshcws -ResourceGroupName azps_test_group .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace .Notes COMPLEX PARAMETER PROPERTIES @@ -3315,10 +3688,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.healthcareapis/update-azhealthcareapisworkspace #> function Update-AzHealthcareApisWorkspace { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('WorkspaceName')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] @@ -3326,12 +3701,16 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -3342,16 +3721,28 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3420,6 +3811,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3441,10 +3841,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareApisWorkspace_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareApisWorkspace_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.HealthcareApis.private\Update-AzHealthcareApisWorkspace_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.HealthcareApis.private\Update-AzHealthcareApisWorkspace_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3458,6 +3858,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3503,9 +3906,9 @@ end { <# .Synopsis -Patch DICOM Service details. +Update a DICOM Service resource with the specified parameters. .Description -Patch DICOM Service details. +Update a DICOM Service resource with the specified parameters. .Example Update-AzHealthcareDicomService -Name azpsdicom -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Tag @{"123"="abc"} .Example @@ -3514,7 +3917,7 @@ Get-AzHealthcareDicomService -Name azpsdicom -ResourceGroupName azps_test_group .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService .Notes COMPLEX PARAMETER PROPERTIES @@ -3534,69 +3937,496 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/update-azhealthcaredicomservice #> function Update-AzHealthcareDicomService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory)] [Alias('DicomServiceName')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of DICOM Service resource. ${Name}, - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [System.String] + # The name of the resource group that contains the service instance. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription identifier. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [System.String] + # The name of workspace resource. + ${WorkspaceName}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Nullable[System.Boolean]] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # An etag associated with the resource, used for optimistic concurrency when editing it. + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Control permission for data plane traffic coming from public networks while private endpoint is enabled. + ${PublicNetworkAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.private\Update-AzHealthcareDicomService_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareDicomService_UpdateViaIdentityExpanded'; + UpdateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareDicomService_UpdateViaIdentityWorkspaceExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } 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.HealthcareApis.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 FHIR Service resource with the specified parameters. +.Description +Update a FHIR Service resource with the specified parameters. +.Example +Update-AzHealthcareFhirService -Name azpsfhirservice -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Tag @{"123"="abc"} +.Example +Get-AzHealthcareFhirService -Name azpsfhirservice -ResourceGroupName azps_test_group -WorkspaceName azpshcws | Update-AzHealthcareFhirService -Tag @{"123"="abc"} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService +.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. + +ACCESSPOLICYOBJECTID : Fhir Service access policies. + ObjectId : An Azure AD object ID (User or Apps) that is allowed access to the FHIR service. + +ACRCONFIGURATIONOCIARTIFACT : The list of Open Container Initiative (OCI) artifacts. + [Digest ]: The artifact digest. + [ImageName ]: The artifact name. + [LoginServer ]: The Azure Container Registry login server. + +INPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. +.Link +https://learn.microsoft.com/powershell/module/az.healthcareapis/update-azhealthcarefhirservice +#> +function Update-AzHealthcareFhirService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory)] + [Alias('FhirServiceName')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [System.String] + # The name of FHIR Service resource. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [System.String] + # The name of the resource group that contains the service instance. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription identifier. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [System.String] + # The name of workspace resource. + ${WorkspaceName}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry[]] + # Fhir Service access policies. + ${AccessPolicyObjectId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The list of the Azure container registry login servers. + ${AcrConfigurationLoginServer}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[]] + # The list of Open Container Initiative (OCI) artifacts. + ${AcrConfigurationOciArtifact}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # If credentials are allowed via CORS. + ${AllowCorsCredential}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # The audience url for the service + ${Audience}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # The authority url for the service + ${Authority}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The headers to be allowed via CORS. + ${CorsHeader}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Int32] + # The max age to be allowed via CORS. + ${CorsMaxAge}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The methods to be allowed via CORS. + ${CorsMethod}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The origins to be allowed via CORS. + ${CorsOrigin}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # If the SMART on FHIR proxy is enabled + ${EnableSmartProxy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Nullable[System.Boolean]] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] - # The name of the resource group that contains the service instance. - ${ResourceGroupName}, + # An etag associated with the resource, used for optimistic concurrency when editing it. + ${Etag}, - [Parameter(ParameterSetName='UpdateExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] - # The subscription identifier. - ${SubscriptionId}, + # The name of the default export storage account. + ${ExportStorageAccountName}, - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir-Stu3", "fhir-R4")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] - # The name of workspace resource. - ${WorkspaceName}, + # The kind of the service. + ${Kind}, - [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Control permission for data plane traffic coming from public networks while private endpoint is enabled. + ${PublicNetworkAccess}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("no-version", "versioned", "versioned-update")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, + [System.String] + # The default value for tracking history across all resources. + ${ResourceVersionPolicyConfigurationDefault}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides]))] [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, + # A list of FHIR Resources and their version policy overrides. + ${ResourceVersionPolicyConfigurationResourceTypeOverride}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3665,6 +4495,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3684,12 +4523,11 @@ begin { } $mapping = @{ - UpdateExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareDicomService_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareDicomService_UpdateViaIdentityExpanded'; + UpdateExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareFhirService_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareFhirService_UpdateViaIdentityExpanded'; + UpdateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareFhirService_UpdateViaIdentityWorkspaceExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3703,6 +4541,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3748,18 +4589,17 @@ end { <# .Synopsis -Patch FHIR Service details. +Update an IoT Connector FHIR destination resource with the specified parameters. .Description -Patch FHIR Service details. -.Example -Update-AzHealthcareFhirService -Name azpsfhirservice -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Tag @{"123"="abc"} +Update an IoT Connector FHIR destination resource with the specified parameters. .Example -Get-AzHealthcareFhirService -Name azpsfhirservice -ResourceGroupName azps_test_group -WorkspaceName azpshcws | Update-AzHealthcareFhirService -Tag @{"123"="abc"} +$arr = @() +Update-AzHealthcareIotConnectorFhirDestination -FhirDestinationName azpsfhirdestination -IotConnectorName azpsiotconnector -ResourceGroupName azps_test_group -WorkspaceName azpshcws -FhirServiceResourceId "/subscriptions/{SubscriptionId}/resourceGroups/azps_test_group/providers/Microsoft.HealthcareApis/workspaces/azpshcws/fhirservices/azpsfhirservice" -ResourceIdentityResolutionType 'Create' -FhirMappingContent @{"templateType"="CollectionFhirTemplate";"template"=$arr} .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination .Notes COMPLEX PARAMETER PROPERTIES @@ -3779,19 +4619,57 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +IOTCONNECTORINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link -https://learn.microsoft.com/powershell/module/az.healthcareapis/update-azhealthcarefhirservice +https://learn.microsoft.com/powershell/module/az.healthcareapis/update-azhealthcareiotconnectorfhirdestination #> -function Update-AzHealthcareFhirService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService])] +function Update-AzHealthcareIotConnectorFhirDestination { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Alias('FhirServiceName')] + [Parameter(ParameterSetName='UpdateViaIdentityIotconnectorExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] - # The name of FHIR Service resource. - ${Name}, + # The name of IoT Connector FHIR destination resource. + ${FhirDestinationName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [System.String] + # The name of IoT Connector resource. + ${IotConnectorName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] @@ -3816,31 +4694,45 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityIotconnectorExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${IotconnectorInputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType])] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, + [System.String] + # An etag associated with the resource, used for optimistic concurrency when editing it. + ${Etag}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent]))] [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, + # The mapping. + ${FhirMappingContent}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, + [System.String] + # Fully qualified resource id of the FHIR service to connect to. + ${FhirServiceResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Create", "Lookup")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Determines how resource identity is resolved on the destination. + ${ResourceIdentityResolutionType}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -3910,6 +4802,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3929,12 +4830,12 @@ begin { } $mapping = @{ - UpdateExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareFhirService_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareFhirService_UpdateViaIdentityExpanded'; + UpdateExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareIotConnectorFhirDestination_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareIotConnectorFhirDestination_UpdateViaIdentityExpanded'; + UpdateViaIdentityIotconnectorExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareIotConnectorFhirDestination_UpdateViaIdentityIotconnectorExpanded'; + UpdateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareIotConnectorFhirDestination_UpdateViaIdentityWorkspaceExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3948,6 +4849,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3993,9 +4897,9 @@ end { <# .Synopsis -Patch an IoT Connector. +Update an IoT Connector resource with the specified parameters. .Description -Patch an IoT Connector. +Update an IoT Connector resource with the specified parameters. .Example Update-AzHealthcareIotConnector -Name azpsiotconnector -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Tag @{"123"="abc"} .Example @@ -4004,7 +4908,7 @@ Get-AzHealthcareIotConnector -Name azpsiotconnector -ResourceGroupName azps_test .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector .Notes COMPLEX PARAMETER PROPERTIES @@ -4024,14 +4928,30 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/update-azhealthcareiotconnector #> function Update-AzHealthcareIotConnector { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory)] [Alias('IotConnectorName')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] @@ -4061,32 +4981,66 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType])] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent]))] + [System.Collections.Hashtable] + # The mapping. + ${DeviceMappingContent}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities]))] - [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, + [System.Nullable[System.Boolean]] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # An etag associated with the resource, used for optimistic concurrency when editing it. + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Consumer group of the event hub to connected to. + ${IngestionEndpointConfigurationConsumerGroup}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Event Hub name to connect to. + ${IngestionEndpointConfigurationEventHubName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Fully qualified namespace of the Event Hub to connect to. + ${IngestionEndpointConfigurationFullyQualifiedEventHubNamespace}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -4155,6 +5109,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -4176,10 +5139,9 @@ begin { $mapping = @{ UpdateExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareIotConnector_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareIotConnector_UpdateViaIdentityExpanded'; + UpdateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareIotConnector_UpdateViaIdentityWorkspaceExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -4193,6 +5155,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -4245,7 +5210,7 @@ Create or update the metadata of a service instance. New-AzHealthcareApisService -ResourceGroupName azps_test_group -Name azpsapiservice -Kind 'fhir' -Location eastus2 -CosmosOfferThroughput 400 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription .Notes COMPLEX PARAMETER PROPERTIES @@ -4262,12 +5227,12 @@ ACRCONFIGURATIONOCIARTIFACT : The list of Open Conta PRIVATEENDPOINTCONNECTION : The list of private endpoint connections that are set up for this resource. [PrivateLinkServiceConnectionStateActionsRequired ]: A message indicating if changes on the service provider require any updates on the consumer. [PrivateLinkServiceConnectionStateDescription ]: The reason for approval/rejection of the connection. - [PrivateLinkServiceConnectionStateStatus ]: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + [PrivateLinkServiceConnectionStateStatus ]: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareapisservice #> function New-AzHealthcareApisService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -4289,152 +5254,161 @@ param( # The subscription identifier. ${SubscriptionId}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind])] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir", "fhir-Stu3", "fhir-R4")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind] + [System.String] # The kind of the service. ${Kind}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Int32] # The provisioned throughput for the backing database. ${CosmosOfferThroughput}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry[]] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntry[]] # The access policies of the service instance. - # To construct, see NOTES section for ACCESSPOLICYOBJECTID properties and create a hash table. ${AccessPolicyObjectId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The list of the ACR login servers. ${AcrConfigurationLoginServer}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[]] # The list of Open Container Initiative (OCI) artifacts. - # To construct, see NOTES section for ACRCONFIGURATIONOCIARTIFACT properties and create a hash table. ${AcrConfigurationOciArtifact}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Management.Automation.SwitchParameter] # If credentials are allowed via CORS. ${AllowCorsCredential}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The audience url for the service ${Audience}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The authority url for the service ${Authority}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The headers to be allowed via CORS. ${CorsHeader}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Int32] # The max age to be allowed via CORS. ${CorsMaxAge}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The methods to be allowed via CORS. ${CorsMethod}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The origins to be allowed via CORS. ${CorsOrigin}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The URI of the customer-managed key for the backing database. ${CosmosKeyVaultKeyUri}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Management.Automation.SwitchParameter] # If the SMART on FHIR proxy is enabled ${EnableSmartProxy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The name of the default export storage account. ${ExportStorageAccountName}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection[]] # The list of private endpoint connections that are set up for this resource. - # To construct, see NOTES section for PRIVATEENDPOINTCONNECTION properties and create a hash table. ${PrivateEndpointConnection}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess] + [System.String] # Control permission for data plane traffic coming from public networks while private endpoint is enabled. ${PublicNetworkAccess}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags]))] [System.Collections.Hashtable] # The resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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()] @@ -4496,6 +5470,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -4516,10 +5499,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareApisService'; + CreateViaJsonFilePath = 'Az.HealthcareApis.custom\New-AzHealthcareApisService'; + CreateViaJsonString = 'Az.HealthcareApis.custom\New-AzHealthcareApisService'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -4533,6 +5516,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -4585,12 +5571,12 @@ Creates or updates a workspace resource with the specified parameters. New-AzHealthcareApisWorkspace -Name azpshcws -ResourceGroupName azps_test_group -Location eastus2 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareapisworkspace #> function New-AzHealthcareApisWorkspace { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -4613,38 +5599,51 @@ param( # The subscription identifier. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess] + [System.String] # Control permission for data plane traffic coming from public networks while private endpoint is enabled. ${PublicNetworkAccess}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, + [System.String] + # Json string supplied to the Create operation + ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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()] @@ -4706,6 +5705,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -4726,10 +5734,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareApisWorkspace'; + CreateViaJsonFilePath = 'Az.HealthcareApis.custom\New-AzHealthcareApisWorkspace'; + CreateViaJsonString = 'Az.HealthcareApis.custom\New-AzHealthcareApisWorkspace'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -4743,6 +5751,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -4794,13 +5805,34 @@ Creates or updates a DICOM Service resource with the specified parameters. .Example New-AzHealthcareDicomService -Name azpsdicom -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Location eastus2 +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService +.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. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcaredicomservice #> function New-AzHealthcareDicomService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -4810,73 +5842,102 @@ param( # The name of DICOM Service resource. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. ${WorkspaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonString')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The subscription identifier. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities]))] - [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess] + [System.String] # Control permission for data plane traffic coming from public networks while private endpoint is enabled. ${PublicNetworkAccess}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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()] @@ -4938,6 +5999,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -4958,10 +6028,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareDicomService'; + CreateViaJsonString = 'Az.HealthcareApis.custom\New-AzHealthcareDicomService'; + CreateViaJsonFilePath = 'Az.HealthcareApis.custom\New-AzHealthcareDicomService'; + CreateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareDicomService'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonString', 'CreateViaJsonFilePath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -4975,6 +6046,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -5026,8 +6100,10 @@ Creates or updates a FHIR Service resource with the specified parameters. .Example New-AzHealthcareFhirService -Name azpsfhirservice -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Location eastus2 -Kind 'fhir-R4' -Authority "https://login.microsoftonline.com/{DirectoryID}" -Audience "https://azpshcws-{FhirServiceName}.fhir.azurehealthcareapis.com" +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService .Notes COMPLEX PARAMETER PROPERTIES @@ -5040,11 +6116,26 @@ ACRCONFIGURATIONOCIARTIFACT : The list of Open Conta [Digest ]: The artifact digest. [ImageName ]: The artifact name. [LoginServer ]: The Azure Container Registry login server. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcarefhirservice #> function New-AzHealthcareFhirService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -5054,174 +6145,216 @@ param( # The name of FHIR Service resource. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. ${WorkspaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonString')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The subscription identifier. ${SubscriptionId}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind])] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir-Stu3", "fhir-R4")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind] + [System.String] # The kind of the service. ${Kind}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry[]] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry[]] # Fhir Service access policies. - # To construct, see NOTES section for ACCESSPOLICYOBJECTID properties and create a hash table. ${AccessPolicyObjectId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The list of the Azure container registry login servers. ${AcrConfigurationLoginServer}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[]] # The list of Open Container Initiative (OCI) artifacts. - # To construct, see NOTES section for ACRCONFIGURATIONOCIARTIFACT properties and create a hash table. ${AcrConfigurationOciArtifact}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Management.Automation.SwitchParameter] # If credentials are allowed via CORS. ${AllowCorsCredential}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The audience url for the service ${Audience}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The authority url for the service ${Authority}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The headers to be allowed via CORS. ${CorsHeader}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Int32] # The max age to be allowed via CORS. ${CorsMaxAge}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The methods to be allowed via CORS. ${CorsMethod}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The origins to be allowed via CORS. ${CorsOrigin}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Management.Automation.SwitchParameter] # If the SMART on FHIR proxy is enabled ${EnableSmartProxy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The name of the default export storage account. ${ExportStorageAccountName}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities]))] - [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess] + [System.String] # Control permission for data plane traffic coming from public networks while private endpoint is enabled. ${PublicNetworkAccess}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("no-version", "versioned", "versioned-update")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy] + [System.String] # The default value for tracking history across all resources. ${ResourceVersionPolicyConfigurationDefault}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides]))] [System.Collections.Hashtable] # A list of FHIR Resources and their version policy overrides. ${ResourceVersionPolicyConfigurationResourceTypeOverride}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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()] @@ -5283,6 +6416,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -5303,10 +6445,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareFhirService'; + CreateViaJsonString = 'Az.HealthcareApis.custom\New-AzHealthcareFhirService'; + CreateViaJsonFilePath = 'Az.HealthcareApis.custom\New-AzHealthcareFhirService'; + CreateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareFhirService'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonString', 'CreateViaJsonFilePath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -5320,6 +6463,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -5372,13 +6518,34 @@ Creates or updates an IoT Connector resource with the specified parameters. $arr = @() New-AzHealthcareIotConnector -Name azpsiotconnector -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Location eastus2 -IngestionEndpointConfigurationConsumerGroup "sajob-01-portal_input-01_consumer_group" -IngestionEndpointConfigurationEventHubName "sajob01portaleventhub" -IngestionEndpointConfigurationFullyQualifiedEventHubNamespace "sdk-Namespace-4761.servicebus.windows.net" -DeviceMappingContent @{"templateType"="CollectionContent";"template"=$arr} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector +.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. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareiotconnector #> function New-AzHealthcareIotConnector { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -5388,91 +6555,123 @@ param( # The name of IoT Connector resource. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. ${WorkspaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonString')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The subscription identifier. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent]))] [System.Collections.Hashtable] # The mapping. ${DeviceMappingContent}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # Consumer group of the event hub to connected to. ${IngestionEndpointConfigurationConsumerGroup}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # Event Hub name to connect to. ${IngestionEndpointConfigurationEventHubName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # Fully qualified namespace of the Event Hub to connect to. ${IngestionEndpointConfigurationFullyQualifiedEventHubNamespace}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities]))] - [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, + [System.String] + # Json string supplied to the Create operation + ${JsonString}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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()] @@ -5534,6 +6733,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -5554,10 +6762,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareIotConnector'; + CreateViaJsonString = 'Az.HealthcareApis.custom\New-AzHealthcareIotConnector'; + CreateViaJsonFilePath = 'Az.HealthcareApis.custom\New-AzHealthcareIotConnector'; + CreateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareIotConnector'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonString', 'CreateViaJsonFilePath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -5571,6 +6780,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -5623,13 +6835,49 @@ Creates or updates an IoT Connector FHIR destination resource with the specified $arr = @() New-AzHealthcareIotConnectorFhirDestination -FhirDestinationName azpsfhirdestination -IotConnectorName azpsiotconnector -ResourceGroupName azps_test_group -WorkspaceName azpshcws -FhirServiceResourceId "/subscriptions/{SubscriptionId}/resourceGroups/azps_test_group/providers/Microsoft.HealthcareApis/workspaces/azpshcws/fhirservices/azpsfhirservice" -ResourceIdentityResolutionType 'Create' -Location eastus2 -FhirMappingContent @{"templateType"="CollectionFhirTemplate";"template"=$arr} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination +.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. + +IOTCONNECTORINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareiotconnectorfhirdestination #> function New-AzHealthcareIotConnectorFhirDestination { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -5638,69 +6886,113 @@ param( # The name of IoT Connector FHIR destination resource. ${FhirDestinationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of IoT Connector resource. ${IotConnectorName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. ${WorkspaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonString')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The subscription identifier. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${IotconnectorInputObject}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # Fully qualified resource id of the FHIR service to connect to. ${FhirServiceResourceId}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType])] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Create", "Lookup")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType] + [System.String] # Determines how resource identity is resolved on the destination. ${ResourceIdentityResolutionType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent]))] [System.Collections.Hashtable] # The mapping. ${FhirMappingContent}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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()] @@ -5762,6 +7054,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -5782,10 +7083,12 @@ begin { $mapping = @{ CreateExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareIotConnectorFhirDestination'; + CreateViaJsonString = 'Az.HealthcareApis.custom\New-AzHealthcareIotConnectorFhirDestination'; + CreateViaJsonFilePath = 'Az.HealthcareApis.custom\New-AzHealthcareIotConnectorFhirDestination'; + CreateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareIotConnectorFhirDestination'; + CreateViaIdentityIotconnectorExpanded = 'Az.HealthcareApis.custom\New-AzHealthcareIotConnectorFhirDestination'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonString', 'CreateViaJsonFilePath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -5799,6 +7102,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareApisService.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareApisService.ps1 index 28abab589ba1..8c192399f4d4 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareApisService.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareApisService.ps1 @@ -77,7 +77,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -154,6 +153,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -176,9 +184,7 @@ begin { Delete = 'Az.HealthcareApis.private\Remove-AzHealthcareApisService_Delete'; DeleteViaIdentity = 'Az.HealthcareApis.private\Remove-AzHealthcareApisService_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -192,6 +198,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareApisWorkspace.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareApisWorkspace.ps1 index b5358fb2fde3..3731d62f4d26 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareApisWorkspace.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareApisWorkspace.ps1 @@ -78,7 +78,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -155,6 +154,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -177,9 +185,7 @@ begin { Delete = 'Az.HealthcareApis.private\Remove-AzHealthcareApisWorkspace_Delete'; DeleteViaIdentity = 'Az.HealthcareApis.private\Remove-AzHealthcareApisWorkspace_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -193,6 +199,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareDicomService.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareDicomService.ps1 index 3045564ca90b..49caa9a54d0d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareDicomService.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareDicomService.ps1 @@ -33,6 +33,21 @@ 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. +DICOMSERVICEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. + INPUTOBJECT : Identity Parameter [DicomServiceName ]: The name of DICOM Service resource. [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. @@ -75,6 +90,7 @@ param( ${SubscriptionId}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityDicomservice', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. @@ -84,9 +100,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityDicomservice', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${DicomserviceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -161,6 +182,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -182,10 +212,9 @@ begin { $mapping = @{ Delete = 'Az.HealthcareApis.private\Remove-AzHealthcareDicomService_Delete'; DeleteViaIdentity = 'Az.HealthcareApis.private\Remove-AzHealthcareDicomService_DeleteViaIdentity'; + DeleteViaIdentityDicomservice = 'Az.HealthcareApis.private\Remove-AzHealthcareDicomService_DeleteViaIdentityDicomservice'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -199,6 +228,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareFhirService.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareFhirService.ps1 index ca7d130d07ec..5745c9d10489 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareFhirService.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareFhirService.ps1 @@ -33,6 +33,21 @@ 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. +FHIRSERVICEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. + INPUTOBJECT : Identity Parameter [DicomServiceName ]: The name of DICOM Service resource. [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. @@ -75,6 +90,7 @@ param( ${SubscriptionId}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityFhirservice', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. @@ -84,9 +100,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityFhirservice', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${FhirserviceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -161,6 +182,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -182,10 +212,9 @@ begin { $mapping = @{ Delete = 'Az.HealthcareApis.private\Remove-AzHealthcareFhirService_Delete'; DeleteViaIdentity = 'Az.HealthcareApis.private\Remove-AzHealthcareFhirService_DeleteViaIdentity'; + DeleteViaIdentityFhirservice = 'Az.HealthcareApis.private\Remove-AzHealthcareFhirService_DeleteViaIdentityFhirservice'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -199,6 +228,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareIotConnector.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareIotConnector.ps1 index b74c58792350..ce77ff8b0ec7 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareIotConnector.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareIotConnector.ps1 @@ -47,6 +47,21 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +IOTCONNECTORINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/remove-azhealthcareiotconnector #> @@ -75,6 +90,7 @@ param( ${SubscriptionId}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityIotconnector', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. @@ -84,9 +100,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityIotconnector', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${IotconnectorInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -161,6 +182,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -182,10 +212,9 @@ begin { $mapping = @{ Delete = 'Az.HealthcareApis.private\Remove-AzHealthcareIotConnector_Delete'; DeleteViaIdentity = 'Az.HealthcareApis.private\Remove-AzHealthcareIotConnector_DeleteViaIdentity'; + DeleteViaIdentityIotconnector = 'Az.HealthcareApis.private\Remove-AzHealthcareIotConnector_DeleteViaIdentityIotconnector'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -199,6 +228,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareIotConnectorFhirDestination.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareIotConnectorFhirDestination.ps1 index 01facc9cb4f6..c884c64213fe 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareIotConnectorFhirDestination.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Remove-AzHealthcareIotConnectorFhirDestination.ps1 @@ -47,6 +47,36 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +IOTCONNECTORINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/remove-azhealthcareiotconnectorfhirdestination #> @@ -55,12 +85,15 @@ function Remove-AzHealthcareIotConnectorFhirDestination { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityIotconnector', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityWorkspace', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of IoT Connector FHIR destination resource. ${FhirDestinationName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityWorkspace', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of IoT Connector resource. @@ -89,9 +122,20 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityIotconnector', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${IotconnectorInputObject}, + + [Parameter(ParameterSetName='DeleteViaIdentityWorkspace', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -166,6 +210,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -187,10 +240,10 @@ begin { $mapping = @{ Delete = 'Az.HealthcareApis.private\Remove-AzHealthcareIotConnectorFhirDestination_Delete'; DeleteViaIdentity = 'Az.HealthcareApis.private\Remove-AzHealthcareIotConnectorFhirDestination_DeleteViaIdentity'; + DeleteViaIdentityIotconnector = 'Az.HealthcareApis.private\Remove-AzHealthcareIotConnectorFhirDestination_DeleteViaIdentityIotconnector'; + DeleteViaIdentityWorkspace = 'Az.HealthcareApis.private\Remove-AzHealthcareIotConnectorFhirDestination_DeleteViaIdentityWorkspace'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -204,6 +257,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Test-AzHealthcareServiceNameAvailability.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Test-AzHealthcareServiceNameAvailability.ps1 index b2c3d951c35e..2b40e552bf92 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Test-AzHealthcareServiceNameAvailability.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Test-AzHealthcareServiceNameAvailability.ps1 @@ -23,11 +23,9 @@ Check if a service instance name is available. Test-AzHealthcareServiceNameAvailability -Name azpsdicom -Type Microsoft.HealthcareApis/services .Inputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo .Notes COMPLEX PARAMETER PROPERTIES @@ -36,66 +34,50 @@ To create the parameters described below, construct a hash table containing the CHECKNAMEAVAILABILITYINPUT : Input values. Name : The name of the service instance to check. Type : The fully qualified resource type which includes provider namespace. - -INPUTOBJECT : Identity Parameter - [DicomServiceName ]: The name of DICOM Service resource. - [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. - [FhirServiceName ]: The name of FHIR Service resource. - [GroupName ]: The name of the private link resource group. - [Id ]: Resource identity path - [IotConnectorName ]: The name of IoT Connector resource. - [LocationName ]: The location of the operation. - [OperationResultId ]: The ID of the operation result to get. - [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource - [ResourceGroupName ]: The name of the resource group that contains the service instance. - [ResourceName ]: The name of the service instance. - [SubscriptionId ]: The subscription identifier. - [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/test-azhealthcareservicenameavailability #> function Test-AzHealthcareServiceNameAvailability { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo])] [CmdletBinding(DefaultParameterSetName='CheckExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Check')] - [Parameter(ParameterSetName='CheckExpanded')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The subscription identifier. ${SubscriptionId}, - [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='CheckViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - [Parameter(ParameterSetName='Check', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters] # Input values. - # To construct, see NOTES section for CHECKNAMEAVAILABILITYINPUT properties and create a hash table. ${CheckNameAvailabilityInput}, [Parameter(ParameterSetName='CheckExpanded', Mandatory)] - [Parameter(ParameterSetName='CheckViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The name of the service instance to check. ${Name}, [Parameter(ParameterSetName='CheckExpanded', Mandatory)] - [Parameter(ParameterSetName='CheckViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The fully qualified resource type which includes provider namespace. ${Type}, + [Parameter(ParameterSetName='CheckViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Check operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CheckViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Check operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -152,6 +134,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -173,12 +164,10 @@ begin { $mapping = @{ Check = 'Az.HealthcareApis.private\Test-AzHealthcareServiceNameAvailability_Check'; CheckExpanded = 'Az.HealthcareApis.private\Test-AzHealthcareServiceNameAvailability_CheckExpanded'; - CheckViaIdentity = 'Az.HealthcareApis.private\Test-AzHealthcareServiceNameAvailability_CheckViaIdentity'; - CheckViaIdentityExpanded = 'Az.HealthcareApis.private\Test-AzHealthcareServiceNameAvailability_CheckViaIdentityExpanded'; + CheckViaJsonFilePath = 'Az.HealthcareApis.private\Test-AzHealthcareServiceNameAvailability_CheckViaJsonFilePath'; + CheckViaJsonString = 'Az.HealthcareApis.private\Test-AzHealthcareServiceNameAvailability_CheckViaJsonString'; } - if (('Check', 'CheckExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Check', 'CheckExpanded', 'CheckViaJsonFilePath', 'CheckViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -192,6 +181,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareApisService.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareApisService.ps1 index dd408addd7c9..ab5c30d8901a 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareApisService.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareApisService.ps1 @@ -27,7 +27,7 @@ Get-AzHealthcareApisService -ResourceGroupName azps_test_group -Name azpsapiserv .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription .Notes COMPLEX PARAMETER PROPERTIES @@ -51,22 +51,28 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.healthcareapis/update-azhealthcareapisservice #> function Update-AzHealthcareApisService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the service instance. ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -77,23 +83,36 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess] + [System.String] # Control permission for data plane traffic coming from public networks while private endpoint is enabled. ${PublicNetworkAccess}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags]))] [System.Collections.Hashtable] # Instance tags ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -162,6 +181,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -183,10 +211,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareApisService_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareApisService_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.HealthcareApis.private\Update-AzHealthcareApisService_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.HealthcareApis.private\Update-AzHealthcareApisService_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -200,6 +228,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareApisWorkspace.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareApisWorkspace.ps1 index 4d871f9c8c8f..05d0bae18682 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareApisWorkspace.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareApisWorkspace.ps1 @@ -27,7 +27,7 @@ Get-AzHealthcareApisWorkspace -Name azpshcws -ResourceGroupName azps_test_group .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace .Notes COMPLEX PARAMETER PROPERTIES @@ -51,10 +51,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.healthcareapis/update-azhealthcareapisworkspace #> function Update-AzHealthcareApisWorkspace { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('WorkspaceName')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] @@ -62,12 +64,16 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -78,16 +84,28 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -156,6 +174,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -177,10 +204,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareApisWorkspace_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareApisWorkspace_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.HealthcareApis.private\Update-AzHealthcareApisWorkspace_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.HealthcareApis.private\Update-AzHealthcareApisWorkspace_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -194,6 +221,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareDicomService.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareDicomService.ps1 index f0d179b5cb49..ba77636a58bb 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareDicomService.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareDicomService.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Patch DICOM Service details. +Update a DICOM Service resource with the specified parameters. .Description -Patch DICOM Service details. +Update a DICOM Service resource with the specified parameters. .Example Update-AzHealthcareDicomService -Name azpsdicom -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Tag @{"123"="abc"} .Example @@ -27,7 +27,7 @@ Get-AzHealthcareDicomService -Name azpsdicom -ResourceGroupName azps_test_group .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService .Notes COMPLEX PARAMETER PROPERTIES @@ -47,14 +47,30 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/update-azhealthcaredicomservice #> function Update-AzHealthcareDicomService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory)] [Alias('DicomServiceName')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] @@ -84,32 +100,48 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType])] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, + [System.Nullable[System.Boolean]] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities]))] - [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, + [System.String] + # An etag associated with the resource, used for optimistic concurrency when editing it. + ${Etag}, [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] + [System.String] + # Control permission for data plane traffic coming from public networks while private endpoint is enabled. + ${PublicNetworkAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -178,6 +210,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -199,10 +240,9 @@ begin { $mapping = @{ UpdateExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareDicomService_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareDicomService_UpdateViaIdentityExpanded'; + UpdateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareDicomService_UpdateViaIdentityWorkspaceExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -216,6 +256,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareFhirService.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareFhirService.ps1 index 63938e4afd6f..0a475cef00ed 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareFhirService.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareFhirService.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Patch FHIR Service details. +Update a FHIR Service resource with the specified parameters. .Description -Patch FHIR Service details. +Update a FHIR Service resource with the specified parameters. .Example Update-AzHealthcareFhirService -Name azpsfhirservice -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Tag @{"123"="abc"} .Example @@ -27,12 +27,20 @@ Get-AzHealthcareFhirService -Name azpsfhirservice -ResourceGroupName azps_test_g .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService .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. +ACCESSPOLICYOBJECTID : Fhir Service access policies. + ObjectId : An Azure AD object ID (User or Apps) that is allowed access to the FHIR service. + +ACRCONFIGURATIONOCIARTIFACT : The list of Open Container Initiative (OCI) artifacts. + [Digest ]: The artifact digest. + [ImageName ]: The artifact name. + [LoginServer ]: The Azure Container Registry login server. + INPUTOBJECT : Identity Parameter [DicomServiceName ]: The name of DICOM Service resource. [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. @@ -47,14 +55,30 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/update-azhealthcarefhirservice #> function Update-AzHealthcareFhirService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory)] [Alias('FhirServiceName')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] @@ -84,32 +108,147 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry[]] + # Fhir Service access policies. + ${AccessPolicyObjectId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The list of the Azure container registry login servers. + ${AcrConfigurationLoginServer}, + [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType])] + [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[]] + # The list of Open Container Initiative (OCI) artifacts. + ${AcrConfigurationOciArtifact}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities]))] + [System.Management.Automation.SwitchParameter] + # If credentials are allowed via CORS. + ${AllowCorsCredential}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # The audience url for the service + ${Audience}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # The authority url for the service + ${Authority}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The headers to be allowed via CORS. + ${CorsHeader}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Int32] + # The max age to be allowed via CORS. + ${CorsMaxAge}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The methods to be allowed via CORS. + ${CorsMethod}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The origins to be allowed via CORS. + ${CorsOrigin}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # If the SMART on FHIR proxy is enabled + ${EnableSmartProxy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Nullable[System.Boolean]] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # An etag associated with the resource, used for optimistic concurrency when editing it. + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # The name of the default export storage account. + ${ExportStorageAccountName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir-Stu3", "fhir-R4")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # The kind of the service. + ${Kind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Control permission for data plane traffic coming from public networks while private endpoint is enabled. + ${PublicNetworkAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("no-version", "versioned", "versioned-update")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # The default value for tracking history across all resources. + ${ResourceVersionPolicyConfigurationDefault}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides]))] [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, + # A list of FHIR Resources and their version policy overrides. + ${ResourceVersionPolicyConfigurationResourceTypeOverride}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -178,6 +317,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -199,10 +347,9 @@ begin { $mapping = @{ UpdateExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareFhirService_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareFhirService_UpdateViaIdentityExpanded'; + UpdateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareFhirService_UpdateViaIdentityWorkspaceExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -216,6 +363,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareIotConnector.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareIotConnector.ps1 index 3ed78a500047..2aa87cef2f6d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareIotConnector.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareIotConnector.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Patch an IoT Connector. +Update an IoT Connector resource with the specified parameters. .Description -Patch an IoT Connector. +Update an IoT Connector resource with the specified parameters. .Example Update-AzHealthcareIotConnector -Name azpsiotconnector -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Tag @{"123"="abc"} .Example @@ -27,7 +27,7 @@ Get-AzHealthcareIotConnector -Name azpsiotconnector -ResourceGroupName azps_test .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector .Notes COMPLEX PARAMETER PROPERTIES @@ -47,14 +47,30 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/update-azhealthcareiotconnector #> function Update-AzHealthcareIotConnector { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory)] [Alias('IotConnectorName')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] @@ -84,32 +100,66 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType])] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent]))] + [System.Collections.Hashtable] + # The mapping. + ${DeviceMappingContent}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities]))] - [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, + [System.Nullable[System.Boolean]] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # An etag associated with the resource, used for optimistic concurrency when editing it. + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Consumer group of the event hub to connected to. + ${IngestionEndpointConfigurationConsumerGroup}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Event Hub name to connect to. + ${IngestionEndpointConfigurationEventHubName}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] + [System.String] + # Fully qualified namespace of the Event Hub to connect to. + ${IngestionEndpointConfigurationFullyQualifiedEventHubNamespace}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -178,6 +228,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -199,10 +258,9 @@ begin { $mapping = @{ UpdateExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareIotConnector_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareIotConnector_UpdateViaIdentityExpanded'; + UpdateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareIotConnector_UpdateViaIdentityWorkspaceExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -216,6 +274,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareIotConnectorFhirDestination.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareIotConnectorFhirDestination.ps1 new file mode 100644 index 000000000000..619389217e30 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/exports/Update-AzHealthcareIotConnectorFhirDestination.ps1 @@ -0,0 +1,323 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Update an IoT Connector FHIR destination resource with the specified parameters. +.Description +Update an IoT Connector FHIR destination resource with the specified parameters. +.Example +$arr = @() +Update-AzHealthcareIotConnectorFhirDestination -FhirDestinationName azpsfhirdestination -IotConnectorName azpsiotconnector -ResourceGroupName azps_test_group -WorkspaceName azpshcws -FhirServiceResourceId "/subscriptions/{SubscriptionId}/resourceGroups/azps_test_group/providers/Microsoft.HealthcareApis/workspaces/azpshcws/fhirservices/azpsfhirservice" -ResourceIdentityResolutionType 'Create' -FhirMappingContent @{"templateType"="CollectionFhirTemplate";"template"=$arr} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination +.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 + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. + +IOTCONNECTORINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. +.Link +https://learn.microsoft.com/powershell/module/az.healthcareapis/update-azhealthcareiotconnectorfhirdestination +#> +function Update-AzHealthcareIotConnectorFhirDestination { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityIotconnectorExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [System.String] + # The name of IoT Connector FHIR destination resource. + ${FhirDestinationName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [System.String] + # The name of IoT Connector resource. + ${IotConnectorName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [System.String] + # The name of the resource group that contains the service instance. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription identifier. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [System.String] + # The name of workspace resource. + ${WorkspaceName}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityIotconnectorExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${IotconnectorInputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # An etag associated with the resource, used for optimistic concurrency when editing it. + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent]))] + [System.Collections.Hashtable] + # The mapping. + ${FhirMappingContent}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Fully qualified resource id of the FHIR service to connect to. + ${FhirServiceResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Create", "Lookup")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Determines how resource identity is resolved on the destination. + ${ResourceIdentityResolutionType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.private\Update-AzHealthcareIotConnectorFhirDestination_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareIotConnectorFhirDestination_UpdateViaIdentityExpanded'; + UpdateViaIdentityIotconnectorExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareIotConnectorFhirDestination_UpdateViaIdentityIotconnectorExpanded'; + UpdateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareIotConnectorFhirDestination_UpdateViaIdentityWorkspaceExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } 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.HealthcareApis.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/generated/HealthcareApis/HealthcareApis.Autorest/generate-info.json b/generated/HealthcareApis/HealthcareApis.Autorest/generate-info.json index e5a5b549728f..778445ac1cfd 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generate-info.json +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "7a934b1e-1c82-402f-ac2c-6365de62c421" + "generate_Id": "f20baf8b-8a4b-4fb8-904b-b5cecbed2ced" } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/Module.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/Module.cs index 367c6fdb5ac1..d0560f60952b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/Module.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/Module.cs @@ -28,12 +28,20 @@ public partial class Module public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler(); + private static bool _init = false; + + private static readonly global::System.Object _initLock = new global::System.Object(); + + private static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline _pipelineWithProxy; + private static readonly global::System.Object _singletonLock = new global::System.Object(); + public bool _useProxy = false; public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); @@ -56,11 +64,8 @@ public partial class Module /// The delegate to get the telemetry info. public GetTelemetryInfoDelegate GetTelemetryInfo { get; set; } - /// Backing field for property. - private static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis"; @@ -125,9 +130,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Cr /// Initialization steps performed after the module is loaded. public void Init() { - OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); - OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); - CustomInit(); + if (_init == false) + { + lock (_initLock) { + if (_init == false) { + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); + CustomInit(); + _init = true; + } + } + } } /// Creates the module instance. diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/HealthcareApis.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/HealthcareApis.cs index 66d5b34d77af..622bb8a19b37 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/HealthcareApis.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/HealthcareApis.cs @@ -14,9 +14,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis public partial class HealthcareApis { - /// Creates or updates a DICOM Service resource with the specified parameters. - /// The name of the resource group that contains the service instance. + /// update a DICOM Service resource with the specified parameters. /// The subscription identifier. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. /// The name of DICOM Service resource. /// The parameters for creating or updating a Dicom Service resource. @@ -25,10 +25,11 @@ public partial class HealthcareApis /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 DicomServicesCreateOrUpdate(string resourceGroupName, string subscriptionId, string workspaceName, string dicomServiceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesCreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, string dicomServiceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -57,15 +58,15 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DicomServicesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.DicomServicesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Creates or updates a DICOM Service resource with the specified parameters. + /// update a DICOM Service resource with the specified parameters. /// /// The parameters for creating or updating a Dicom Service resource. /// a delegate that is called when the remote service returns 200 (OK). @@ -73,10 +74,11 @@ public partial class HealthcareApis /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 DicomServicesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -91,8 +93,8 @@ public partial class HealthcareApis } // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; var workspaceName = _match.Groups["workspaceName"].Value; var dicomServiceName = _match.Groups["dicomServiceName"].Value; // construct URL @@ -118,210 +120,138 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DicomServicesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.DicomServicesCreateOrUpdate_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 DICOM Service resource with the specified parameters. + /// + /// The parameters for creating or updating a Dicom Service resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 DicomServicesCreateOrUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // verify that Identity format is an exact match for uri - // 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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.UndeclaredResponseException(_response); - } - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/dicomservices/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}'"); + } - // 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.HealthcareApis.Runtime.Method.Get); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + var dicomServiceName = _match.Groups["dicomServiceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/dicomservices/" + + dicomServiceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DicomServicesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The name of the resource group that contains the service instance. + /// update a DICOM Service resource with the specified parameters. /// The subscription identifier. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. /// The name of DICOM Service resource. - /// The parameters for creating or updating a Dicom Service resource. + /// Json string supplied to the DicomServicesCreateOrUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 DicomServicesCreateOrUpdate_Validate(string resourceGroupName, string subscriptionId, string workspaceName, string dicomServiceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task DicomServicesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string workspaceName, string dicomServiceName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { + var apiVersion = @"2021-11-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); - await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); - await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - await eventListener.AssertNotNull(nameof(dicomServiceName),dicomServiceName); - await eventListener.AssertMinimumLength(nameof(dicomServiceName),dicomServiceName,3); - await eventListener.AssertMaximumLength(nameof(dicomServiceName),dicomServiceName,24); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/dicomservices/" + + global::System.Uri.EscapeDataString(dicomServiceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DicomServicesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Deletes a DICOM Service. + /// update a DICOM Service resource with the specified parameters. /// The subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of DICOM Service resource. /// The name of workspace 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). + /// The name of DICOM Service resource. + /// Json string supplied to the DicomServicesCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 DicomServicesDelete(string subscriptionId, string resourceGroupName, string dicomServiceName, string workspaceName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string workspaceName, string dicomServiceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -341,113 +271,105 @@ public partial class HealthcareApis + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.DicomServicesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.DicomServicesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Deletes a DICOM Service. - /// - /// 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 DICOM Service resource with the specified parameters. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of DICOM Service resource. + /// The parameters for creating or updating a Dicom Service resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 DicomServicesDeleteViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string workspaceName, string dicomServiceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)/dicomservices/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var dicomServiceName = _match.Groups["dicomServiceName"].Value; - var workspaceName = _match.Groups["workspaceName"].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.HealthcareApis/workspaces/" - + workspaceName + + global::System.Uri.EscapeDataString(workspaceName) + "/dicomservices/" - + dicomServiceName + + global::System.Uri.EscapeDataString(dicomServiceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.DicomServicesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.DicomServicesCreateOrUpdateWithResult_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.HealthcareApis.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 DicomServicesDelete_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DicomServicesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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.HealthcareApis.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"))) { @@ -456,62 +378,61 @@ public partial class HealthcareApis 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; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -519,40 +440,192 @@ public partial class HealthcareApis 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.HealthcareApis.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 DicomServicesCreateOrUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } - case global::System.Net.HttpStatusCode.NoContent: + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -568,18 +641,19 @@ public partial class HealthcareApis } /// - /// 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 subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of DICOM Service resource. /// The name of workspace resource. + /// The name of DICOM Service resource. + /// The parameters for creating or updating a Dicom Service 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 DicomServicesDelete_Validate(string subscriptionId, string resourceGroupName, string dicomServiceName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task DicomServicesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string dicomServiceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -587,22 +661,25 @@ public partial class HealthcareApis await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(dicomServiceName),dicomServiceName); - await eventListener.AssertMinimumLength(nameof(dicomServiceName),dicomServiceName,3); - await eventListener.AssertMaximumLength(nameof(dicomServiceName),dicomServiceName,24); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); + await eventListener.AssertNotNull(nameof(dicomServiceName),dicomServiceName); + await eventListener.AssertMinimumLength(nameof(dicomServiceName),dicomServiceName,3); + await eventListener.AssertMaximumLength(nameof(dicomServiceName),dicomServiceName,24); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Gets the properties of the specified DICOM Service. - /// The name of the resource group that contains the service instance. + /// Deletes a DICOM Service. /// The subscription identifier. - /// The name of workspace resource. + /// The name of the resource group that contains the service instance. /// The name of DICOM Service resource. + /// The name of workspace 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. @@ -610,7 +687,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DicomServicesGet(string resourceGroupName, string subscriptionId, string workspaceName, string dicomServiceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesDelete(string subscriptionId, string resourceGroupName, string dicomServiceName, string workspaceName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -634,18 +711,19 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DicomServicesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.DicomServicesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Gets the properties of the specified DICOM Service. + /// Deletes a DICOM Service. /// /// 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. @@ -653,7 +731,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DicomServicesGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesDeleteViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -668,10 +746,10 @@ public partial class HealthcareApis } // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; - var workspaceName = _match.Groups["workspaceName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; var dicomServiceName = _match.Groups["dicomServiceName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -690,18 +768,19 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DicomServicesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.DicomServicesDelete_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. @@ -709,17 +788,114 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task DicomServicesGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DicomServicesDelete_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -727,13 +903,19 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -749,39 +931,40 @@ public partial class HealthcareApis } /// - /// 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 name of the resource group that contains the service instance. /// The subscription identifier. - /// The name of workspace resource. + /// The name of the resource group that contains the service instance. /// The name of DICOM Service resource. + /// The name of workspace 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 DicomServicesGet_Validate(string resourceGroupName, string subscriptionId, string workspaceName, string dicomServiceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task DicomServicesDelete_Validate(string subscriptionId, string resourceGroupName, string dicomServiceName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); - await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); - await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(dicomServiceName),dicomServiceName); await eventListener.AssertMinimumLength(nameof(dicomServiceName),dicomServiceName,3); await eventListener.AssertMaximumLength(nameof(dicomServiceName),dicomServiceName,24); + await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); + await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); + await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); } } - /// Lists all DICOM Services for the given workspace - /// The name of the resource group that contains the service instance. + /// Gets the properties of the specified DICOM Service. /// The subscription identifier. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. + /// The name of DICOM Service 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). @@ -790,7 +973,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DicomServicesListByWorkspace(string resourceGroupName, string subscriptionId, string workspaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesGet(string subscriptionId, string resourceGroupName, string workspaceName, string dicomServiceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -804,7 +987,8 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/dicomservices" + + "/dicomservices/" + + global::System.Uri.EscapeDataString(dicomServiceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -818,11 +1002,11 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DicomServicesListByWorkspace_Call(request,onOk,onDefault,eventListener,sender); + await this.DicomServicesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Lists all DICOM Services for the given workspace + /// Gets the properties of the specified DICOM 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 @@ -832,7 +1016,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DicomServicesListByWorkspaceViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -840,16 +1024,17 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/dicomservices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/dicomservices/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/dicomservices'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}'"); } // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; var workspaceName = _match.Groups["workspaceName"].Value; + var dicomServiceName = _match.Groups["dicomServiceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -858,7 +1043,8 @@ public partial class HealthcareApis + resourceGroupName + "/providers/Microsoft.HealthcareApis/workspaces/" + workspaceName - + "/dicomservices" + + "/dicomservices/" + + dicomServiceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -872,100 +1058,76 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DicomServicesListByWorkspace_Call(request,onOk,onDefault,eventListener,sender); + await this.DicomServicesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Gets the properties of the specified DICOM Service. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 DicomServicesListByWorkspace_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)/dicomservices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}'"); + } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 workspaceName = _match.Groups["workspaceName"].Value; + var dicomServiceName = _match.Groups["dicomServiceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/dicomservices/" + + dicomServiceName + + "?" + + "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 name of the resource group that contains the service instance. - /// The subscription identifier. - /// The name of workspace 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 DicomServicesListByWorkspace_Validate(string resourceGroupName, string subscriptionId, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); - await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); - await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DicomServicesGetWithResult_Call (request, eventListener,sender); } } - /// Patch DICOM Service details. - /// The name of the resource group that contains the service instance. + /// Gets the properties of the specified DICOM Service. /// The subscription identifier. - /// The name of DICOM Service resource. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The parameters for updating a Dicom 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). + /// The name of DICOM Service resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 DicomServicesUpdate(string resourceGroupName, string subscriptionId, string dicomServiceName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePatchResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesGetWithResult(string subscriptionId, string resourceGroupName, string workspaceName, string dicomServiceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -985,85 +1147,80 @@ public partial class HealthcareApis + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.DicomServicesUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.DicomServicesGetWithResult_Call (request, eventListener,sender); } } - /// Patch DICOM Service details. - /// - /// The parameters for updating a Dicom 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 DicomServicesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePatchResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DicomServicesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { - var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis/workspaces/(?[^/]+)/dicomservices/(?[^/]+)$", 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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; - var dicomServiceName = _match.Groups["dicomServiceName"].Value; - var workspaceName = _match.Groups["workspaceName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HealthcareApis/workspaces/" - + workspaceName - + "/dicomservices/" - + dicomServiceName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.DicomServicesUpdate_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 @@ -1073,7 +1230,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task DicomServicesUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DicomServicesGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1084,105 +1241,7 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1190,13 +1249,13 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1212,43 +1271,39 @@ public partial class HealthcareApis } /// - /// 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 name of the resource group that contains the service instance. /// The subscription identifier. - /// The name of DICOM Service resource. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The parameters for updating a Dicom Service. + /// The name of DICOM Service 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 DicomServicesUpdate_Validate(string resourceGroupName, string subscriptionId, string dicomServiceName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePatchResource body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task DicomServicesGet_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string dicomServiceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(dicomServiceName),dicomServiceName); - await eventListener.AssertMinimumLength(nameof(dicomServiceName),dicomServiceName,3); - await eventListener.AssertMaximumLength(nameof(dicomServiceName),dicomServiceName,24); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(dicomServiceName),dicomServiceName); + await eventListener.AssertMinimumLength(nameof(dicomServiceName),dicomServiceName,3); + await eventListener.AssertMaximumLength(nameof(dicomServiceName),dicomServiceName,24); } } - /// Lists all FHIR destinations for the given IoT Connector - /// The name of the resource group that contains the service instance. + /// Lists all DICOM Services for the given workspace /// The subscription identifier. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The name of IoT Connector 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). @@ -1257,7 +1312,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task FhirDestinationsListByIotConnector(string resourceGroupName, string subscriptionId, string workspaceName, string iotConnectorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesListByWorkspace(string subscriptionId, string resourceGroupName, string workspaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -1271,9 +1326,7 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/iotconnectors/" - + global::System.Uri.EscapeDataString(iotConnectorName) - + "/fhirdestinations" + + "/dicomservices" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1287,11 +1340,11 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.FhirDestinationsListByIotConnector_Call(request,onOk,onDefault,eventListener,sender); + await this.DicomServicesListByWorkspace_Call (request, onOk,onDefault,eventListener,sender); } } - /// Lists all FHIR destinations for the given IoT Connector + /// Lists all DICOM Services for the given workspace /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -1301,7 +1354,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task FhirDestinationsListByIotConnectorViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesListByWorkspaceViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -1309,17 +1362,16 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)/fhirdestinations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/dicomservices$", 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.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices'"); } // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; var workspaceName = _match.Groups["workspaceName"].Value; - var iotConnectorName = _match.Groups["iotConnectorName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -1328,9 +1380,7 @@ public partial class HealthcareApis + resourceGroupName + "/providers/Microsoft.HealthcareApis/workspaces/" + workspaceName - + "/iotconnectors/" - + iotConnectorName - + "/fhirdestinations" + + "/dicomservices" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1344,104 +1394,73 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.FhirDestinationsListByIotConnector_Call(request,onOk,onDefault,eventListener,sender); + await this.DicomServicesListByWorkspace_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 DICOM Services for the given workspace + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 FhirDestinationsListByIotConnector_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesListByWorkspaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { + var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotFhirDestinationCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/dicomservices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. - /// - /// The name of the resource group that contains the service instance. - /// The subscription identifier. - /// The name of workspace resource. - /// The name of IoT Connector 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 FhirDestinationsListByIotConnector_Validate(string resourceGroupName, string subscriptionId, string workspaceName, string iotConnectorName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); - await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); - await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - await eventListener.AssertNotNull(nameof(iotConnectorName),iotConnectorName); - await eventListener.AssertMinimumLength(nameof(iotConnectorName),iotConnectorName,3); - await eventListener.AssertMaximumLength(nameof(iotConnectorName),iotConnectorName,24); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/dicomservices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DicomServicesListByWorkspaceWithResult_Call (request, eventListener,sender); } } - /// Creates or updates a FHIR Service resource with the specified parameters. - /// The name of the resource group that contains the service instance. + /// Lists all DICOM Services for the given workspace /// The subscription identifier. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The name of FHIR Service resource. - /// The parameters for creating or updating a Fhir Service 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.HealthcareApis.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 FhirServicesCreateOrUpdate(string resourceGroupName, string subscriptionId, string workspaceName, string fhirServiceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesListByWorkspaceWithResult(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -1455,91 +1474,87 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/fhirservices/" - + global::System.Uri.EscapeDataString(fhirServiceName) + + "/dicomservices" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.FhirServicesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.DicomServicesListByWorkspaceWithResult_Call (request, eventListener,sender); } } - /// Creates or updates a FHIR Service resource with the specified parameters. - /// - /// The parameters for creating or updating a Fhir Service 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). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 FhirServicesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DicomServicesListByWorkspaceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { - var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis/workspaces/(?[^/]+)/fhirservices/(?[^/]+)$", 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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; - var workspaceName = _match.Groups["workspaceName"].Value; - var fhirServiceName = _match.Groups["fhirServiceName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HealthcareApis/workspaces/" - + workspaceName - + "/fhirservices/" - + fhirServiceName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.FhirServicesCreateOrUpdate_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 @@ -1549,7 +1564,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task FhirServicesCreateOrUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DicomServicesListByWorkspace_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1560,105 +1575,7 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1666,13 +1583,13 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1688,53 +1605,47 @@ public partial class HealthcareApis } /// - /// 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 name of the resource group that contains the service instance. /// The subscription identifier. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The name of FHIR Service resource. - /// The parameters for creating or updating a Fhir Service 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 FhirServicesCreateOrUpdate_Validate(string resourceGroupName, string subscriptionId, string workspaceName, string fhirServiceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task DicomServicesListByWorkspace_Validate(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - await eventListener.AssertNotNull(nameof(fhirServiceName),fhirServiceName); - await eventListener.AssertMinimumLength(nameof(fhirServiceName),fhirServiceName,3); - await eventListener.AssertMaximumLength(nameof(fhirServiceName),fhirServiceName,24); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Deletes a FHIR Service. + /// Patch DICOM Service details. /// The subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of FHIR Service resource. + /// The name of DICOM Service resource. /// The name of workspace resource. + /// The parameters for updating a Dicom Service. /// 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.HealthcareApis.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 FhirServicesDelete(string subscriptionId, string resourceGroupName, string fhirServiceName, string workspaceName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesUpdate(string subscriptionId, string resourceGroupName, string dicomServiceName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePatchResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -1748,8 +1659,8 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/fhirservices/" - + global::System.Uri.EscapeDataString(fhirServiceName) + + "/dicomservices/" + + global::System.Uri.EscapeDataString(dicomServiceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1758,27 +1669,32 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.FhirServicesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.DicomServicesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Deletes a FHIR Service. + /// Patch DICOM Service details. /// + /// The parameters for updating a Dicom Service. /// 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.HealthcareApis.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 FhirServicesDeleteViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePatchResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -1786,16 +1702,16 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/fhirservices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/dicomservices/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var fhirServiceName = _match.Groups["fhirServiceName"].Value; + var dicomServiceName = _match.Groups["dicomServiceName"].Value; var workspaceName = _match.Groups["workspaceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( @@ -1805,8 +1721,8 @@ public partial class HealthcareApis + resourceGroupName + "/providers/Microsoft.HealthcareApis/workspaces/" + workspaceName - + "/fhirservices/" - + fhirServiceName + + "/dicomservices/" + + dicomServiceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1815,206 +1731,85 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.FhirServicesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.DicomServicesUpdate_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). + /// Patch DICOM Service details. + /// + /// The parameters for updating a Dicom Service. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 FhirServicesDelete_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePatchResource body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // verify that Identity format is an exact match for uri - // 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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.UndeclaredResponseException(_response); - } - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/dicomservices/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}'"); + } - // 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.HealthcareApis.Runtime.Method.Get); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var dicomServiceName = _match.Groups["dicomServiceName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/dicomservices/" + + dicomServiceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DicomServicesUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// + /// Patch DICOM Service details. /// The subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of FHIR Service resource. - /// The name of workspace 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 FhirServicesDelete_Validate(string subscriptionId, string resourceGroupName, string fhirServiceName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(fhirServiceName),fhirServiceName); - await eventListener.AssertMinimumLength(nameof(fhirServiceName),fhirServiceName,3); - await eventListener.AssertMaximumLength(nameof(fhirServiceName),fhirServiceName,24); - await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); - await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); - await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - } - } - - /// Gets the properties of the specified FHIR Service. - /// The name of the resource group that contains the service instance. - /// The subscription identifier. + /// The name of DICOM Service resource. /// The name of workspace resource. - /// The name of FHIR Service resource. + /// Json string supplied to the DicomServicesUpdate operation /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -2023,7 +1818,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task FhirServicesGet(string resourceGroupName, string subscriptionId, string workspaceName, string fhirServiceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string dicomServiceName, string workspaceName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -2037,8 +1832,8 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/fhirservices/" - + global::System.Uri.EscapeDataString(fhirServiceName) + + "/dicomservices/" + + global::System.Uri.EscapeDataString(dicomServiceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2047,106 +1842,404 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.FhirServicesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.DicomServicesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets the properties of the specified FHIR 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). + /// Patch DICOM Service details. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of DICOM Service resource. + /// The name of workspace resource. + /// Json string supplied to the DicomServicesUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 FhirServicesGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string dicomServiceName, string workspaceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)/fhirservices/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}'"); - } - - // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; - var workspaceName = _match.Groups["workspaceName"].Value; - var fhirServiceName = _match.Groups["fhirServiceName"].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.HealthcareApis/workspaces/" - + workspaceName - + "/fhirservices/" - + fhirServiceName + + global::System.Uri.EscapeDataString(workspaceName) + + "/dicomservices/" + + global::System.Uri.EscapeDataString(dicomServiceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.FhirServicesGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.DicomServicesUpdateWithResult_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). + /// Patch DICOM Service details. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of DICOM Service resource. + /// The name of workspace resource. + /// The parameters for updating a Dicom Service. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 FhirServicesGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DicomServicesUpdateWithResult(string subscriptionId, string resourceGroupName, string dicomServiceName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePatchResource body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/dicomservices/" + + global::System.Uri.EscapeDataString(dicomServiceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DicomServicesUpdateWithResult_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.HealthcareApis.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 DicomServicesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 DicomServicesUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2162,39 +2255,43 @@ public partial class HealthcareApis } /// - /// 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 name of the resource group that contains the service instance. /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of DICOM Service resource. /// The name of workspace resource. - /// The name of FHIR Service resource. + /// The parameters for updating a Dicom 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 FhirServicesGet_Validate(string resourceGroupName, string subscriptionId, string workspaceName, string fhirServiceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task DicomServicesUpdate_Validate(string subscriptionId, string resourceGroupName, string dicomServiceName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePatchResource body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(dicomServiceName),dicomServiceName); + await eventListener.AssertMinimumLength(nameof(dicomServiceName),dicomServiceName,3); + await eventListener.AssertMaximumLength(nameof(dicomServiceName),dicomServiceName,24); await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - await eventListener.AssertNotNull(nameof(fhirServiceName),fhirServiceName); - await eventListener.AssertMinimumLength(nameof(fhirServiceName),fhirServiceName,3); - await eventListener.AssertMaximumLength(nameof(fhirServiceName),fhirServiceName,24); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Lists all FHIR Services for the given workspace - /// The name of the resource group that contains the service instance. + /// Lists all FHIR destinations for the given IoT Connector /// The subscription identifier. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. + /// The name of IoT Connector 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). @@ -2203,7 +2300,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task FhirServicesListByWorkspace(string resourceGroupName, string subscriptionId, string workspaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirDestinationsListByIotConnector(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -2217,7 +2314,9 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/fhirservices" + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + + "/fhirdestinations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2231,11 +2330,11 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.FhirServicesListByWorkspace_Call(request,onOk,onDefault,eventListener,sender); + await this.FhirDestinationsListByIotConnector_Call (request, onOk,onDefault,eventListener,sender); } } - /// Lists all FHIR Services for the given workspace + /// Lists all FHIR destinations for the given IoT Connector /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -2245,7 +2344,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task FhirServicesListByWorkspaceViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirDestinationsListByIotConnectorViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -2253,16 +2352,17 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/fhirservices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)/fhirdestinations$", 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.HealthcareApis/workspaces/{workspaceName}/fhirservices'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations'"); } // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; var workspaceName = _match.Groups["workspaceName"].Value; + var iotConnectorName = _match.Groups["iotConnectorName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -2271,7 +2371,9 @@ public partial class HealthcareApis + resourceGroupName + "/providers/Microsoft.HealthcareApis/workspaces/" + workspaceName - + "/fhirservices" + + "/iotconnectors/" + + iotConnectorName + + "/fhirdestinations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2285,100 +2387,77 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.FhirServicesListByWorkspace_Call(request,onOk,onDefault,eventListener,sender); + await this.FhirDestinationsListByIotConnector_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 FHIR destinations for the given IoT Connector + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 FhirServicesListByWorkspace_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirDestinationsListByIotConnectorViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)/fhirdestinations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations'"); + } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 workspaceName = _match.Groups["workspaceName"].Value; + var iotConnectorName = _match.Groups["iotConnectorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/iotconnectors/" + + iotConnectorName + + "/fhirdestinations" + + "?" + + "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 name of the resource group that contains the service instance. - /// The subscription identifier. - /// The name of workspace 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 FhirServicesListByWorkspace_Validate(string resourceGroupName, string subscriptionId, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); - await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); - await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.FhirDestinationsListByIotConnectorWithResult_Call (request, eventListener,sender); } } - /// Patch FHIR Service details. - /// The name of the resource group that contains the service instance. + /// Lists all FHIR destinations for the given IoT Connector /// The subscription identifier. - /// The name of FHIR Service resource. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The parameters for updating a Fhir 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). + /// The name of IoT Connector resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 FhirServicesUpdate(string resourceGroupName, string subscriptionId, string fhirServiceName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePatchResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirDestinationsListByIotConnectorWithResult(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -2392,91 +2471,89 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/fhirservices/" - + global::System.Uri.EscapeDataString(fhirServiceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + + "/fhirdestinations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.FhirServicesUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.FhirDestinationsListByIotConnectorWithResult_Call (request, eventListener,sender); } } - /// Patch FHIR Service details. - /// - /// The parameters for updating a Fhir 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). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 FhirServicesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePatchResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task FhirDestinationsListByIotConnectorWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { - var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis/workspaces/(?[^/]+)/fhirservices/(?[^/]+)$", 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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestinationCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; - var fhirServiceName = _match.Groups["fhirServiceName"].Value; - var workspaceName = _match.Groups["workspaceName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HealthcareApis/workspaces/" - + workspaceName - + "/fhirservices/" - + fhirServiceName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.FhirServicesUpdate_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 @@ -2486,7 +2563,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task FhirServicesUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task FhirDestinationsListByIotConnector_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2497,105 +2574,7 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2603,13 +2582,13 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestinationCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2625,56 +2604,51 @@ public partial class HealthcareApis } /// - /// 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 name of the resource group that contains the service instance. /// The subscription identifier. - /// The name of FHIR Service resource. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The parameters for updating a Fhir Service. + /// The name of IoT Connector 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 FhirServicesUpdate_Validate(string resourceGroupName, string subscriptionId, string fhirServiceName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePatchResource body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task FhirDestinationsListByIotConnector_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(fhirServiceName),fhirServiceName); - await eventListener.AssertMinimumLength(nameof(fhirServiceName),fhirServiceName,3); - await eventListener.AssertMaximumLength(nameof(fhirServiceName),fhirServiceName,24); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(iotConnectorName),iotConnectorName); + await eventListener.AssertMinimumLength(nameof(iotConnectorName),iotConnectorName,3); + await eventListener.AssertMaximumLength(nameof(iotConnectorName),iotConnectorName,24); } } - /// - /// Creates or updates an IoT Connector FHIR destination resource with the specified parameters. - /// - /// The name of the resource group that contains the service instance. + /// update a FHIR Service resource with the specified parameters. /// The subscription identifier. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The name of IoT Connector resource. - /// The name of IoT Connector FHIR destination resource. - /// The parameters for creating or updating an IoT Connector FHIR destination resource. + /// The name of FHIR Service resource. + /// The parameters for creating or updating a Fhir Service 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.HealthcareApis.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 IotConnectorFhirDestinationCreateOrUpdate(string resourceGroupName, string subscriptionId, string workspaceName, string iotConnectorName, string fhirDestinationName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirServicesCreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, string fhirServiceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -2688,10 +2662,8 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/iotconnectors/" - + global::System.Uri.EscapeDataString(iotConnectorName) - + "/fhirdestinations/" - + global::System.Uri.EscapeDataString(fhirDestinationName) + + "/fhirservices/" + + global::System.Uri.EscapeDataString(fhirServiceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2705,28 +2677,27 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.IotConnectorFhirDestinationCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.FhirServicesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Creates or updates an IoT Connector FHIR destination resource with the specified parameters. - /// + /// update a FHIR Service resource with the specified parameters. /// - /// The parameters for creating or updating an IoT Connector FHIR destination resource. + /// The parameters for creating or updating a Fhir Service 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.HealthcareApis.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 IotConnectorFhirDestinationCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirServicesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -2734,18 +2705,17 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)/fhirdestinations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/fhirservices/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}'"); } // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; var workspaceName = _match.Groups["workspaceName"].Value; - var iotConnectorName = _match.Groups["iotConnectorName"].Value; - var fhirDestinationName = _match.Groups["fhirDestinationName"].Value; + var fhirServiceName = _match.Groups["fhirServiceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -2754,10 +2724,8 @@ public partial class HealthcareApis + resourceGroupName + "/providers/Microsoft.HealthcareApis/workspaces/" + workspaceName - + "/iotconnectors/" - + iotConnectorName - + "/fhirdestinations/" - + fhirDestinationName + + "/fhirservices/" + + fhirServiceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2771,18 +2739,80 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.IotConnectorFhirDestinationCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.FhirServicesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. + /// update a FHIR Service resource with the specified parameters. + /// + /// The parameters for creating or updating a Fhir Service resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 FhirServicesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)/fhirservices/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + var fhirServiceName = _match.Groups["fhirServiceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/fhirservices/" + + fhirServiceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.FhirServicesCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update a FHIR Service resource with the specified parameters. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of FHIR Service resource. + /// Json string supplied to the FhirServicesCreateOrUpdate operation /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -2791,31 +2821,174 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task IotConnectorFhirDestinationCreateOrUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirServicesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string workspaceName, string fhirServiceName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/fhirservices/" + + global::System.Uri.EscapeDataString(fhirServiceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FhirServicesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update a FHIR Service resource with the specified parameters. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of FHIR Service resource. + /// Json string supplied to the FhirServicesCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 FhirServicesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string workspaceName, string fhirServiceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/fhirservices/" + + global::System.Uri.EscapeDataString(fhirServiceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.FhirServicesCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update a FHIR Service resource with the specified parameters. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of FHIR Service resource. + /// The parameters for creating or updating a Fhir Service resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 FhirServicesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string workspaceName, string fhirServiceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/fhirservices/" + + global::System.Uri.EscapeDataString(fhirServiceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.FhirServicesCreateOrUpdateWithResult_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.HealthcareApis.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 FhirServicesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } // declared final-state-via: default var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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.HealthcareApis.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"))) { @@ -2824,62 +2997,61 @@ public partial class HealthcareApis 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; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -2897,25 +3069,38 @@ public partial class HealthcareApis // make the final call _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotFhirDestination.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -2929,51 +3114,9 @@ public partial class HealthcareApis } } - /// - /// Validation method for method. Call this like the actual call, - /// but you will get validation events back. - /// - /// The name of the resource group that contains the service instance. - /// The subscription identifier. - /// The name of workspace resource. - /// The name of IoT Connector resource. - /// The name of IoT Connector FHIR destination resource. - /// The parameters for creating or updating an IoT Connector FHIR destination 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 IotConnectorFhirDestinationCreateOrUpdate_Validate(string resourceGroupName, string subscriptionId, string workspaceName, string iotConnectorName, string fhirDestinationName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); - await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); - await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - await eventListener.AssertNotNull(nameof(iotConnectorName),iotConnectorName); - await eventListener.AssertMinimumLength(nameof(iotConnectorName),iotConnectorName,3); - await eventListener.AssertMaximumLength(nameof(iotConnectorName),iotConnectorName,24); - await eventListener.AssertNotNull(nameof(fhirDestinationName),fhirDestinationName); - await eventListener.AssertMinimumLength(nameof(fhirDestinationName),fhirDestinationName,3); - await eventListener.AssertMaximumLength(nameof(fhirDestinationName),fhirDestinationName,24); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// Deletes an IoT Connector FHIR destination. - /// The subscription identifier. - /// The name of the resource group that contains the service instance. - /// The name of workspace resource. - /// The name of IoT Connector resource. - /// The name of IoT Connector FHIR destination 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 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. @@ -2981,24 +3124,204 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task IotConnectorFhirDestinationDelete(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, string fhirDestinationName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task FhirServicesCreateOrUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { - var apiVersion = @"2021-11-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of FHIR Service resource. + /// The parameters for creating or updating a Fhir Service 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 FhirServicesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string fhirServiceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); + await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); + await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); + await eventListener.AssertNotNull(nameof(fhirServiceName),fhirServiceName); + await eventListener.AssertMinimumLength(nameof(fhirServiceName),fhirServiceName,3); + await eventListener.AssertMaximumLength(nameof(fhirServiceName),fhirServiceName,24); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes a FHIR Service. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of FHIR Service resource. + /// The name of workspace 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.HealthcareApis.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 FhirServicesDelete(string subscriptionId, string resourceGroupName, string fhirServiceName, string workspaceName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/iotconnectors/" - + global::System.Uri.EscapeDataString(iotConnectorName) - + "/fhirdestinations/" - + global::System.Uri.EscapeDataString(fhirDestinationName) + + "/fhirservices/" + + global::System.Uri.EscapeDataString(fhirServiceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3012,11 +3335,11 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.IotConnectorFhirDestinationDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.FhirServicesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Deletes an IoT Connector FHIR destination. + /// Deletes a FHIR Service. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 204 (NoContent). @@ -3027,7 +3350,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task IotConnectorFhirDestinationDeleteViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirServicesDeleteViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -3035,18 +3358,17 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)/fhirdestinations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/fhirservices/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var fhirServiceName = _match.Groups["fhirServiceName"].Value; var workspaceName = _match.Groups["workspaceName"].Value; - var iotConnectorName = _match.Groups["iotConnectorName"].Value; - var fhirDestinationName = _match.Groups["fhirDestinationName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -3055,10 +3377,8 @@ public partial class HealthcareApis + resourceGroupName + "/providers/Microsoft.HealthcareApis/workspaces/" + workspaceName - + "/iotconnectors/" - + iotConnectorName - + "/fhirdestinations/" - + fhirDestinationName + + "/fhirservices/" + + fhirServiceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3072,11 +3392,11 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.IotConnectorFhirDestinationDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.FhirServicesDelete_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). @@ -3087,32 +3407,29 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task IotConnectorFhirDestinationDelete_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task FhirServicesDelete_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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.HealthcareApis.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"))) { @@ -3121,15 +3438,14 @@ public partial class HealthcareApis 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; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); @@ -3138,45 +3454,45 @@ public partial class HealthcareApis _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -3198,6 +3514,7 @@ public partial class HealthcareApis break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3217,7 +3534,7 @@ public partial class HealthcareApis default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3233,19 +3550,18 @@ public partial class HealthcareApis } /// - /// 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 subscription identifier. /// The name of the resource group that contains the service instance. + /// The name of FHIR Service resource. /// The name of workspace resource. - /// The name of IoT Connector resource. - /// The name of IoT Connector FHIR destination 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 IotConnectorFhirDestinationDelete_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, string fhirDestinationName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task FhirServicesDelete_Validate(string subscriptionId, string resourceGroupName, string fhirServiceName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -3253,25 +3569,21 @@ public partial class HealthcareApis await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(fhirServiceName),fhirServiceName); + await eventListener.AssertMinimumLength(nameof(fhirServiceName),fhirServiceName,3); + await eventListener.AssertMaximumLength(nameof(fhirServiceName),fhirServiceName,24); await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - await eventListener.AssertNotNull(nameof(iotConnectorName),iotConnectorName); - await eventListener.AssertMinimumLength(nameof(iotConnectorName),iotConnectorName,3); - await eventListener.AssertMaximumLength(nameof(iotConnectorName),iotConnectorName,24); - await eventListener.AssertNotNull(nameof(fhirDestinationName),fhirDestinationName); - await eventListener.AssertMinimumLength(nameof(fhirDestinationName),fhirDestinationName,3); - await eventListener.AssertMaximumLength(nameof(fhirDestinationName),fhirDestinationName,24); } } - /// Gets the properties of the specified Iot Connector FHIR destination. - /// The name of the resource group that contains the service instance. + /// Gets the properties of the specified FHIR Service. /// The subscription identifier. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The name of IoT Connector resource. - /// The name of IoT Connector FHIR destination resource. + /// The name of FHIR Service 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). @@ -3280,7 +3592,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task IotConnectorFhirDestinationGet(string resourceGroupName, string subscriptionId, string workspaceName, string iotConnectorName, string fhirDestinationName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirServicesGet(string subscriptionId, string resourceGroupName, string workspaceName, string fhirServiceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -3294,10 +3606,8 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/iotconnectors/" - + global::System.Uri.EscapeDataString(iotConnectorName) - + "/fhirdestinations/" - + global::System.Uri.EscapeDataString(fhirDestinationName) + + "/fhirservices/" + + global::System.Uri.EscapeDataString(fhirServiceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3311,11 +3621,11 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.IotConnectorFhirDestinationGet_Call(request,onOk,onDefault,eventListener,sender); + await this.FhirServicesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets the properties of the specified Iot Connector FHIR destination. + /// Gets the properties of the specified FHIR 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 @@ -3325,7 +3635,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task IotConnectorFhirDestinationGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirServicesGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -3333,18 +3643,17 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)/fhirdestinations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/fhirservices/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}'"); } // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; var workspaceName = _match.Groups["workspaceName"].Value; - var iotConnectorName = _match.Groups["iotConnectorName"].Value; - var fhirDestinationName = _match.Groups["fhirDestinationName"].Value; + var fhirServiceName = _match.Groups["fhirServiceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -3353,10 +3662,8 @@ public partial class HealthcareApis + resourceGroupName + "/providers/Microsoft.HealthcareApis/workspaces/" + workspaceName - + "/iotconnectors/" - + iotConnectorName - + "/fhirdestinations/" - + fhirDestinationName + + "/fhirservices/" + + fhirServiceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3370,108 +3677,76 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.IotConnectorFhirDestinationGet_Call(request,onOk,onDefault,eventListener,sender); + await this.FhirServicesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Gets the properties of the specified FHIR Service. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 IotConnectorFhirDestinationGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirServicesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { + var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotFhirDestination.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/fhirservices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The name of the resource group that contains the service instance. - /// The subscription identifier. - /// The name of workspace resource. - /// The name of IoT Connector resource. - /// The name of IoT Connector FHIR destination 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 IotConnectorFhirDestinationGet_Validate(string resourceGroupName, string subscriptionId, string workspaceName, string iotConnectorName, string fhirDestinationName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); - await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); - await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - await eventListener.AssertNotNull(nameof(iotConnectorName),iotConnectorName); - await eventListener.AssertMinimumLength(nameof(iotConnectorName),iotConnectorName,3); - await eventListener.AssertMaximumLength(nameof(iotConnectorName),iotConnectorName,24); - await eventListener.AssertNotNull(nameof(fhirDestinationName),fhirDestinationName); - await eventListener.AssertMinimumLength(nameof(fhirDestinationName),fhirDestinationName,3); - await eventListener.AssertMaximumLength(nameof(fhirDestinationName),fhirDestinationName,24); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + var fhirServiceName = _match.Groups["fhirServiceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/fhirservices/" + + fhirServiceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.FhirServicesGetWithResult_Call (request, eventListener,sender); } } - /// Creates or updates an IoT Connector resource with the specified parameters. - /// The name of the resource group that contains the service instance. + /// Gets the properties of the specified FHIR Service. /// The subscription identifier. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The name of IoT Connector resource. - /// The parameters for creating or updating an IoT Connectors 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). + /// The name of FHIR Service resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 IotConnectorsCreateOrUpdate(string resourceGroupName, string subscriptionId, string workspaceName, string iotConnectorName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirServicesGetWithResult(string subscriptionId, string resourceGroupName, string workspaceName, string fhirServiceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -3485,91 +3760,86 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/iotconnectors/" - + global::System.Uri.EscapeDataString(iotConnectorName) + + "/fhirservices/" + + global::System.Uri.EscapeDataString(fhirServiceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.IotConnectorsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.FhirServicesGetWithResult_Call (request, eventListener,sender); } } - /// Creates or updates an IoT Connector resource with the specified parameters. - /// - /// The parameters for creating or updating an IoT Connectors 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 IotConnectorsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task FhirServicesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { - var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)$", 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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; - var workspaceName = _match.Groups["workspaceName"].Value; - var iotConnectorName = _match.Groups["iotConnectorName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HealthcareApis/workspaces/" - + workspaceName - + "/iotconnectors/" - + iotConnectorName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.IotConnectorsCreateOrUpdate_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 @@ -3579,7 +3849,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task IotConnectorsCreateOrUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task FhirServicesGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3590,105 +3860,7 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3696,13 +3868,13 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnector.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3718,45 +3890,40 @@ public partial class HealthcareApis } /// - /// 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 name of the resource group that contains the service instance. /// The subscription identifier. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The name of IoT Connector resource. - /// The parameters for creating or updating an IoT Connectors resource. + /// The name of FHIR Service 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 IotConnectorsCreateOrUpdate_Validate(string resourceGroupName, string subscriptionId, string workspaceName, string iotConnectorName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task FhirServicesGet_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string fhirServiceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - await eventListener.AssertNotNull(nameof(iotConnectorName),iotConnectorName); - await eventListener.AssertMinimumLength(nameof(iotConnectorName),iotConnectorName,3); - await eventListener.AssertMaximumLength(nameof(iotConnectorName),iotConnectorName,24); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(fhirServiceName),fhirServiceName); + await eventListener.AssertMinimumLength(nameof(fhirServiceName),fhirServiceName,3); + await eventListener.AssertMaximumLength(nameof(fhirServiceName),fhirServiceName,24); } } - /// Deletes an IoT Connector. + /// Lists all FHIR Services for the given workspace /// The subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of IoT Connector resource. /// The name of workspace 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. @@ -3764,7 +3931,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task IotConnectorsDelete(string subscriptionId, string resourceGroupName, string iotConnectorName, string workspaceName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirServicesListByWorkspace(string subscriptionId, string resourceGroupName, string workspaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -3778,8 +3945,7 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/iotconnectors/" - + global::System.Uri.EscapeDataString(iotConnectorName) + + "/fhirservices" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3788,19 +3954,18 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.IotConnectorsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.FhirServicesListByWorkspace_Call (request, onOk,onDefault,eventListener,sender); } } - /// Deletes an IoT Connector. + /// Lists all FHIR Services for the given workspace /// /// 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. @@ -3808,7 +3973,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task IotConnectorsDeleteViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirServicesListByWorkspaceViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -3816,16 +3981,15 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/fhirservices$", 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.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var iotConnectorName = _match.Groups["iotConnectorName"].Value; var workspaceName = _match.Groups["workspaceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( @@ -3835,8 +3999,7 @@ public partial class HealthcareApis + resourceGroupName + "/providers/Microsoft.HealthcareApis/workspaces/" + workspaceName - + "/iotconnectors/" - + iotConnectorName + + "/fhirservices" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3845,215 +4008,78 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.IotConnectorsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.FhirServicesListByWorkspace_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). + /// Lists all FHIR Services for the given workspace + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 IotConnectorsDelete_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirServicesListByWorkspaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { + var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // verify that Identity format is an exact match for uri - // 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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.UndeclaredResponseException(_response); - } - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/fhirservices$", 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.HealthcareApis/workspaces/{workspaceName}/fhirservices'"); + } - // 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.HealthcareApis.Runtime.Method.Get); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/fhirservices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.FhirServicesListByWorkspaceWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// + /// Lists all FHIR Services for the given workspace /// The subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of IoT Connector resource. - /// The name of workspace 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 IotConnectorsDelete_Validate(string subscriptionId, string resourceGroupName, string iotConnectorName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(iotConnectorName),iotConnectorName); - await eventListener.AssertMinimumLength(nameof(iotConnectorName),iotConnectorName,3); - await eventListener.AssertMaximumLength(nameof(iotConnectorName),iotConnectorName,24); - await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); - await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); - await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - } - } - - /// Gets the properties of the specified IoT Connector. - /// The name of the resource group that contains the service instance. - /// The subscription identifier. /// The name of workspace resource. - /// The name of IoT Connector 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.HealthcareApis.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 IotConnectorsGet(string resourceGroupName, string subscriptionId, string workspaceName, string iotConnectorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirServicesListByWorkspaceWithResult(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -4067,82 +4093,87 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/iotconnectors/" - + global::System.Uri.EscapeDataString(iotConnectorName) + + "/fhirservices" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.IotConnectorsGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.FhirServicesListByWorkspaceWithResult_Call (request, eventListener,sender); } } - /// Gets the properties of the specified IoT Connector. - /// - /// a delegate that is 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.HealthcareApis.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 IotConnectorsGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task FhirServicesListByWorkspaceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { - var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)$", 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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; - var workspaceName = _match.Groups["workspaceName"].Value; - var iotConnectorName = _match.Groups["iotConnectorName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HealthcareApis/workspaces/" - + workspaceName - + "/iotconnectors/" - + iotConnectorName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.IotConnectorsGet_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 @@ -4152,7 +4183,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task IotConnectorsGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task FhirServicesListByWorkspace_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4163,6 +4194,7 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4170,13 +4202,13 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnector.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4192,48 +4224,47 @@ public partial class HealthcareApis } /// - /// 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 name of the resource group that contains the service instance. /// The subscription identifier. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The name of IoT Connector 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 IotConnectorsGet_Validate(string resourceGroupName, string subscriptionId, string workspaceName, string iotConnectorName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task FhirServicesListByWorkspace_Validate(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - await eventListener.AssertNotNull(nameof(iotConnectorName),iotConnectorName); - await eventListener.AssertMinimumLength(nameof(iotConnectorName),iotConnectorName,3); - await eventListener.AssertMaximumLength(nameof(iotConnectorName),iotConnectorName,24); } } - /// Lists all IoT Connectors for the given workspace - /// The name of the resource group that contains the service instance. + /// Patch FHIR Service details. /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of FHIR Service resource. /// The name of workspace resource. + /// The parameters for updating a Fhir 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.HealthcareApis.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 IotConnectorsListByWorkspace(string resourceGroupName, string subscriptionId, string workspaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirServicesUpdate(string subscriptionId, string resourceGroupName, string fhirServiceName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePatchResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -4247,7 +4278,8 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/iotconnectors" + + "/fhirservices/" + + global::System.Uri.EscapeDataString(fhirServiceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4256,26 +4288,32 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.IotConnectorsListByWorkspace_Call(request,onOk,onDefault,eventListener,sender); + await this.FhirServicesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Lists all IoT Connectors for the given workspace + /// Patch FHIR Service details. /// + /// The parameters for updating a Fhir 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.HealthcareApis.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 IotConnectorsListByWorkspaceViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirServicesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePatchResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -4283,15 +4321,16 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/iotconnectors$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/fhirservices/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/iotconnectors'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}'"); } // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var fhirServiceName = _match.Groups["fhirServiceName"].Value; var workspaceName = _match.Groups["workspaceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( @@ -4301,7 +4340,8 @@ public partial class HealthcareApis + resourceGroupName + "/providers/Microsoft.HealthcareApis/workspaces/" + workspaceName - + "/iotconnectors" + + "/fhirservices/" + + fhirServiceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4310,105 +4350,143 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.IotConnectorsListByWorkspace_Call(request,onOk,onDefault,eventListener,sender); + await this.FhirServicesUpdate_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). + /// Patch FHIR Service details. + /// + /// The parameters for updating a Fhir Service. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 IotConnectorsListByWorkspace_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirServicesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePatchResource body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnectorCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/fhirservices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var fhirServiceName = _match.Groups["fhirServiceName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/fhirservices/" + + fhirServiceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.FhirServicesUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The name of the resource group that contains the service instance. + /// Patch FHIR Service details. /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of FHIR Service resource. /// The name of workspace resource. + /// Json string supplied to the FhirServicesUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 IotConnectorsListByWorkspace_Validate(string resourceGroupName, string subscriptionId, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task FhirServicesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string fhirServiceName, string workspaceName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { + var apiVersion = @"2021-11-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); - await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); - await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/fhirservices/" + + global::System.Uri.EscapeDataString(fhirServiceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FhirServicesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Patch an IoT Connector. - /// The name of the resource group that contains the service instance. + /// Patch FHIR Service details. /// The subscription identifier. - /// The name of IoT Connector resource. + /// The name of the resource group that contains the service instance. + /// The name of FHIR Service resource. /// The name of workspace resource. - /// The parameters for updating an IoT Connector. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Json string supplied to the FhirServicesUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 IotConnectorsUpdate(string resourceGroupName, string subscriptionId, string iotConnectorName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPatchResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirServicesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string fhirServiceName, string workspaceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -4422,125 +4500,109 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/iotconnectors/" - + global::System.Uri.EscapeDataString(iotConnectorName) + + "/fhirservices/" + + global::System.Uri.EscapeDataString(fhirServiceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.IotConnectorsUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.FhirServicesUpdateWithResult_Call (request, eventListener,sender); } } - /// Patch an IoT Connector. - /// - /// The parameters for updating an IoT Connector. - /// a delegate that is 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). + /// Patch FHIR Service details. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of FHIR Service resource. + /// The name of workspace resource. + /// The parameters for updating a Fhir Service. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 IotConnectorsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPatchResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task FhirServicesUpdateWithResult(string subscriptionId, string resourceGroupName, string fhirServiceName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePatchResource body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}'"); - } - - // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; - var iotConnectorName = _match.Groups["iotConnectorName"].Value; - var workspaceName = _match.Groups["workspaceName"].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.HealthcareApis/workspaces/" - + workspaceName - + "/iotconnectors/" - + iotConnectorName + + global::System.Uri.EscapeDataString(workspaceName) + + "/fhirservices/" + + global::System.Uri.EscapeDataString(fhirServiceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.IotConnectorsUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.FhirServicesUpdateWithResult_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.HealthcareApis.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 IotConnectorsUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task FhirServicesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } // declared final-state-via: default var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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.HealthcareApis.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"))) { @@ -4549,62 +4611,61 @@ public partial class HealthcareApis 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; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -4622,25 +4683,38 @@ public partial class HealthcareApis // make the final call _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnector.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -4654,43 +4728,8 @@ public partial class HealthcareApis } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The name of the resource group that contains the service instance. - /// The subscription identifier. - /// The name of IoT Connector resource. - /// The name of workspace resource. - /// The parameters for updating an IoT Connector. - /// 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 IotConnectorsUpdate_Validate(string resourceGroupName, string subscriptionId, string iotConnectorName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPatchResource body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(iotConnectorName),iotConnectorName); - await eventListener.AssertMinimumLength(nameof(iotConnectorName),iotConnectorName,3); - await eventListener.AssertMaximumLength(nameof(iotConnectorName),iotConnectorName,24); - await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); - await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); - await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// Get the operation result for a long running operation. - /// The subscription identifier. - /// The location of the operation. - /// The ID of the operation result to get. + /// 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). @@ -4699,111 +4738,113 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationResultsGet(string subscriptionId, string locationName, string operationResultId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task FhirServicesUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { - var apiVersion = @"2021-11-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HealthcareApis/locations/" - + global::System.Uri.EscapeDataString(locationName) - + "/operationresults/" - + global::System.Uri.EscapeDataString(operationResultId) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.Runtime.Events.DelayBeforePolling, _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.HealthcareApis.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.OperationResultsGet_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 the operation result for a long running operation. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 OperationResultsGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-11-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/(?[^/]+)/providers/Microsoft.HealthcareApis/locations/(?[^/]+)/operationresults/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/operationresults/{operationResultId}'"); - } + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var locationName = _match.Groups["locationName"].Value; - var operationResultId = _match.Groups["operationResultId"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/providers/Microsoft.HealthcareApis/locations/" - + locationName - + "/operationresults/" - + operationResultId - + "?" - + "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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.OperationResultsGet_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.HealthcareApis.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 OperationResultsGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4811,13 +4852,13 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationResultsDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4833,38 +4874,57 @@ public partial class HealthcareApis } /// - /// 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 subscription identifier. - /// The location of the operation. - /// The ID of the operation result to get. + /// The name of the resource group that contains the service instance. + /// The name of FHIR Service resource. + /// The name of workspace resource. + /// The parameters for updating a Fhir 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 OperationResultsGet_Validate(string subscriptionId, string locationName, string operationResultId, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task FhirServicesUpdate_Validate(string subscriptionId, string resourceGroupName, string fhirServiceName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePatchResource body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(locationName),locationName); - await eventListener.AssertNotNull(nameof(operationResultId),operationResultId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(fhirServiceName),fhirServiceName); + await eventListener.AssertMinimumLength(nameof(fhirServiceName),fhirServiceName,3); + await eventListener.AssertMaximumLength(nameof(fhirServiceName),fhirServiceName,24); + await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); + await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); + await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } /// - /// Lists all of the available operations supported by Microsoft Healthcare resource provider. + /// update an IoT Connector FHIR destination resource with the specified parameters. /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of IoT Connector resource. + /// The name of IoT Connector FHIR destination resource. + /// The parameters for creating or updating an IoT Connector FHIR destination 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.HealthcareApis.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 OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorFhirDestinationCreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, string fhirDestinationName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -4872,7 +4932,16 @@ public partial class HealthcareApis { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.HealthcareApis/operations" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + + "/fhirdestinations/" + + global::System.Uri.EscapeDataString(fhirDestinationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4881,28 +4950,34 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.IotConnectorFhirDestinationCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Lists all of the available operations supported by Microsoft Healthcare resource provider. + /// update an IoT Connector FHIR destination resource with the specified parameters. /// /// + /// The parameters for creating or updating an IoT Connector FHIR destination 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.HealthcareApis.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 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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorFhirDestinationCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -4910,16 +4985,30 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.HealthcareApis/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)/fhirdestinations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.HealthcareApis/operations'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}'"); } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + var iotConnectorName = _match.Groups["iotConnectorName"].Value; + var fhirDestinationName = _match.Groups["fhirDestinationName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.HealthcareApis/operations" + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/iotconnectors/" + + iotConnectorName + + "/fhirdestinations/" + + fhirDestinationName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4928,88 +5017,93 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.IotConnectorFhirDestinationCreateOrUpdate_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 an IoT Connector FHIR destination resource with the specified parameters. + /// + /// + /// The parameters for creating or updating an IoT Connector FHIR destination resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorFhirDestinationCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ListOperations.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)/fhirdestinations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// 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.HealthcareApis.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + var iotConnectorName = _match.Groups["iotConnectorName"].Value; + var fhirDestinationName = _match.Groups["fhirDestinationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/iotconnectors/" + + iotConnectorName + + "/fhirdestinations/" + + fhirDestinationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.IotConnectorFhirDestinationCreateOrUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Update the state of the specified private endpoint connection associated with the service. + /// update an IoT Connector FHIR destination resource with the specified parameters. /// /// The subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of the service instance. - /// The name of the private endpoint connection associated with the Azure resource - /// The private endpoint connection properties. + /// The name of workspace resource. + /// The name of IoT Connector resource. + /// The name of IoT Connector FHIR destination resource. + /// Json string supplied to the IotConnectorFhirDestinationCreateOrUpdate operation /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -5018,7 +5112,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorFhirDestinationCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, string fhirDestinationName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -5030,10 +5124,12 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HealthcareApis/services/" - + global::System.Uri.EscapeDataString(resourceName) - + "/privateEndpointConnections/" - + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + + "/fhirdestinations/" + + global::System.Uri.EscapeDataString(fhirDestinationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5047,79 +5143,282 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.IotConnectorFhirDestinationCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Update the state of the specified private endpoint connection associated with the service. + /// update an IoT Connector FHIR destination resource with the specified parameters. /// - /// - /// The private endpoint connection properties. - /// a delegate that is 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 subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of IoT Connector resource. + /// The name of IoT Connector FHIR destination resource. + /// Json string supplied to the IotConnectorFhirDestinationCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 PrivateEndpointConnectionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorFhirDestinationCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, string fhirDestinationName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + + "/fhirdestinations/" + + global::System.Uri.EscapeDataString(fhirDestinationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/services/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); 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 resourceName = _match.Groups["resourceName"].Value; - var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.IotConnectorFhirDestinationCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update an IoT Connector FHIR destination resource with the specified parameters. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of IoT Connector resource. + /// The name of IoT Connector FHIR destination resource. + /// The parameters for creating or updating an IoT Connector FHIR destination resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 IotConnectorFhirDestinationCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, string fhirDestinationName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HealthcareApis/services/" - + resourceName - + "/privateEndpointConnections/" - + privateEndpointConnectionName + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + + "/fhirdestinations/" + + global::System.Uri.EscapeDataString(fhirDestinationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.PrivateEndpointConnectionsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.IotConnectorFhirDestinationCreateOrUpdateWithResult_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.HealthcareApis.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 IotConnectorFhirDestinationCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestination.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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). @@ -5130,31 +5429,28 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateOrUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task IotConnectorFhirDestinationCreateOrUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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.HealthcareApis.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"))) { @@ -5163,15 +5459,14 @@ public partial class HealthcareApis 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; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); @@ -5180,45 +5475,45 @@ public partial class HealthcareApis _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -5240,6 +5535,7 @@ public partial class HealthcareApis break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5247,13 +5543,13 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateEndpointConnectionDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestination.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5269,19 +5565,20 @@ public partial class HealthcareApis } /// - /// Validation method for method. Call this like the actual call, + /// Validation method for method. Call this like the actual call, /// but you will get validation events back. /// /// The subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of the service instance. - /// The name of the private endpoint connection associated with the Azure resource - /// The private endpoint connection properties. + /// The name of workspace resource. + /// The name of IoT Connector resource. + /// The name of IoT Connector FHIR destination resource. + /// The parameters for creating or updating an IoT Connector FHIR destination 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 PrivateEndpointConnectionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task IotConnectorFhirDestinationCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, string fhirDestinationName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -5289,21 +5586,27 @@ public partial class HealthcareApis await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); - await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); - await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); + await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); + await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); + await eventListener.AssertNotNull(nameof(iotConnectorName),iotConnectorName); + await eventListener.AssertMinimumLength(nameof(iotConnectorName),iotConnectorName,3); + await eventListener.AssertMaximumLength(nameof(iotConnectorName),iotConnectorName,24); + await eventListener.AssertNotNull(nameof(fhirDestinationName),fhirDestinationName); + await eventListener.AssertMinimumLength(nameof(fhirDestinationName),fhirDestinationName,3); + await eventListener.AssertMaximumLength(nameof(fhirDestinationName),fhirDestinationName,24); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Deletes a private endpoint connection. + /// Deletes an IoT Connector FHIR destination. /// The subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of the service instance. - /// The name of the private endpoint connection associated with the Azure resource + /// The name of workspace resource. + /// The name of IoT Connector resource. + /// The name of IoT Connector FHIR destination 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 @@ -5313,7 +5616,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorFhirDestinationDelete(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, string fhirDestinationName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -5325,10 +5628,12 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HealthcareApis/services/" - + global::System.Uri.EscapeDataString(resourceName) - + "/privateEndpointConnections/" - + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + + "/fhirdestinations/" + + global::System.Uri.EscapeDataString(fhirDestinationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5342,11 +5647,11 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.IotConnectorFhirDestinationDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Deletes a private endpoint connection. + /// Deletes an IoT Connector FHIR destination. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 204 (NoContent). @@ -5357,7 +5662,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDeleteViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorFhirDestinationDeleteViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -5365,27 +5670,30 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/services/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)/fhirdestinations/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; - var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + var iotConnectorName = _match.Groups["iotConnectorName"].Value; + var fhirDestinationName = _match.Groups["fhirDestinationName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HealthcareApis/services/" - + resourceName - + "/privateEndpointConnections/" - + privateEndpointConnectionName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/iotconnectors/" + + iotConnectorName + + "/fhirdestinations/" + + fhirDestinationName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5399,11 +5707,11 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.IotConnectorFhirDestinationDelete_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). @@ -5414,32 +5722,29 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task IotConnectorFhirDestinationDelete_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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.HealthcareApis.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"))) { @@ -5448,15 +5753,14 @@ public partial class HealthcareApis 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; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); @@ -5465,45 +5769,45 @@ public partial class HealthcareApis _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -5525,6 +5829,7 @@ public partial class HealthcareApis break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5544,7 +5849,7 @@ public partial class HealthcareApis default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5560,18 +5865,19 @@ public partial class HealthcareApis } /// - /// 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 subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of the service instance. - /// The name of the private endpoint connection associated with the Azure resource + /// The name of workspace resource. + /// The name of IoT Connector resource. + /// The name of IoT Connector FHIR destination 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 PrivateEndpointConnectionsDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task IotConnectorFhirDestinationDelete_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, string fhirDestinationName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -5579,19 +5885,25 @@ public partial class HealthcareApis await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); - await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); - await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); + await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); + await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); + await eventListener.AssertNotNull(nameof(iotConnectorName),iotConnectorName); + await eventListener.AssertMinimumLength(nameof(iotConnectorName),iotConnectorName,3); + await eventListener.AssertMaximumLength(nameof(iotConnectorName),iotConnectorName,24); + await eventListener.AssertNotNull(nameof(fhirDestinationName),fhirDestinationName); + await eventListener.AssertMinimumLength(nameof(fhirDestinationName),fhirDestinationName,3); + await eventListener.AssertMaximumLength(nameof(fhirDestinationName),fhirDestinationName,24); } } - /// Gets the specified private endpoint connection associated with the service. + /// Gets the properties of the specified Iot Connector FHIR destination. /// The subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of the service instance. - /// The name of the private endpoint connection associated with the Azure resource + /// The name of workspace resource. + /// The name of IoT Connector resource. + /// The name of IoT Connector FHIR destination 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). @@ -5600,7 +5912,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorFhirDestinationGet(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, string fhirDestinationName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -5612,10 +5924,12 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HealthcareApis/services/" - + global::System.Uri.EscapeDataString(resourceName) - + "/privateEndpointConnections/" - + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + + "/fhirdestinations/" + + global::System.Uri.EscapeDataString(fhirDestinationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5629,11 +5943,11 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.IotConnectorFhirDestinationGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets the specified private endpoint connection associated with the service. + /// Gets the properties of the specified Iot Connector FHIR destination. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -5643,7 +5957,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorFhirDestinationGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -5651,27 +5965,30 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/services/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)/fhirdestinations/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; - var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + var iotConnectorName = _match.Groups["iotConnectorName"].Value; + var fhirDestinationName = _match.Groups["fhirDestinationName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HealthcareApis/services/" - + resourceName - + "/privateEndpointConnections/" - + privateEndpointConnectionName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/iotconnectors/" + + iotConnectorName + + "/fhirdestinations/" + + fhirDestinationName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5685,11 +6002,177 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.IotConnectorFhirDestinationGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the properties of the specified Iot Connector FHIR destination. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 IotConnectorFhirDestinationGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)/fhirdestinations/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + var iotConnectorName = _match.Groups["iotConnectorName"].Value; + var fhirDestinationName = _match.Groups["fhirDestinationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/iotconnectors/" + + iotConnectorName + + "/fhirdestinations/" + + fhirDestinationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.IotConnectorFhirDestinationGetWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the properties of the specified Iot Connector FHIR destination. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of IoT Connector resource. + /// The name of IoT Connector FHIR destination resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 IotConnectorFhirDestinationGetWithResult(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, string fhirDestinationName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + + "/fhirdestinations/" + + global::System.Uri.EscapeDataString(fhirDestinationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.IotConnectorFhirDestinationGetWithResult_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.HealthcareApis.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 IotConnectorFhirDestinationGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestination.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 @@ -5699,7 +6182,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task IotConnectorFhirDestinationGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -5710,6 +6193,7 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5717,13 +6201,13 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateEndpointConnectionDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestination.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5739,18 +6223,19 @@ public partial class HealthcareApis } /// - /// 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 subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of the service instance. - /// The name of the private endpoint connection associated with the Azure resource + /// The name of workspace resource. + /// The name of IoT Connector resource. + /// The name of IoT Connector FHIR destination 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 PrivateEndpointConnectionsGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task IotConnectorFhirDestinationGet_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, string fhirDestinationName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -5758,27 +6243,35 @@ public partial class HealthcareApis await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); - await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); - await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); - } - } - - /// Lists all private endpoint connections for a service. - /// The subscription identifier. - /// The name of the resource group that contains the service instance. - /// The name of the service instance. + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); + await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); + await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); + await eventListener.AssertNotNull(nameof(iotConnectorName),iotConnectorName); + await eventListener.AssertMinimumLength(nameof(iotConnectorName),iotConnectorName,3); + await eventListener.AssertMaximumLength(nameof(iotConnectorName),iotConnectorName,24); + await eventListener.AssertNotNull(nameof(fhirDestinationName),fhirDestinationName); + await eventListener.AssertMinimumLength(nameof(fhirDestinationName),fhirDestinationName,3); + await eventListener.AssertMaximumLength(nameof(fhirDestinationName),fhirDestinationName,24); + } + } + + /// update an IoT Connector resource with the specified parameters. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of IoT Connector resource. + /// The parameters for creating or updating an IoT Connectors 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.HealthcareApis.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 PrivateEndpointConnectionsListByService(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorsCreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -5790,9 +6283,10 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HealthcareApis/services/" - + global::System.Uri.EscapeDataString(resourceName) - + "/privateEndpointConnections" + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5801,26 +6295,32 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsListByService_Call(request,onOk,onDefault,eventListener,sender); + await this.IotConnectorsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Lists all private endpoint connections for a service. + /// update an IoT Connector resource with the specified parameters. /// + /// The parameters for creating or updating an IoT Connectors 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.HealthcareApis.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 PrivateEndpointConnectionsListByServiceViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -5828,25 +6328,27 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/services/(?[^/]+)/privateEndpointConnections$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}/privateEndpointConnections'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + var iotConnectorName = _match.Groups["iotConnectorName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HealthcareApis/services/" - + resourceName - + "/privateEndpointConnections" + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/iotconnectors/" + + iotConnectorName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5855,106 +6357,143 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsListByService_Call(request,onOk,onDefault,eventListener,sender); + await this.IotConnectorsCreateOrUpdate_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 an IoT Connector resource with the specified parameters. + /// + /// The parameters for creating or updating an IoT Connectors resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 PrivateEndpointConnectionsListByService_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateEndpointConnectionListResultDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + var iotConnectorName = _match.Groups["iotConnectorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/iotconnectors/" + + iotConnectorName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.IotConnectorsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. - /// + /// update an IoT Connector resource with the specified parameters. /// The subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of the service instance. + /// The name of workspace resource. + /// The name of IoT Connector resource. + /// Json string supplied to the IotConnectorsCreateOrUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 PrivateEndpointConnectionsListByService_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task IotConnectorsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { + var apiVersion = @"2021-11-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); - await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IotConnectorsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets a private link resource that need to be created for a service. + /// update an IoT Connector resource with the specified parameters. /// The subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of the service instance. - /// The name of the private link 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). + /// The name of workspace resource. + /// The name of IoT Connector resource. + /// Json string supplied to the IotConnectorsCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 PrivateLinkResourcesGet(string subscriptionId, string resourceGroupName, string resourceName, string groupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -5966,118 +6505,369 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HealthcareApis/services/" - + global::System.Uri.EscapeDataString(resourceName) - + "/privateLinkResources/" - + global::System.Uri.EscapeDataString(groupName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.PrivateLinkResourcesGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.IotConnectorsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Gets a private link resource that need to be created for a 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). + /// update an IoT Connector resource with the specified parameters. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of IoT Connector resource. + /// The parameters for creating or updating an IoT Connectors resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 PrivateLinkResourcesGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)/privateLinkResources/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}/privateLinkResources/{groupName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; - var groupName = _match.Groups["groupName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HealthcareApis/services/" - + resourceName - + "/privateLinkResources/" - + groupName + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.PrivateLinkResourcesGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.IotConnectorsCreateOrUpdateWithResult_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.HealthcareApis.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 PrivateLinkResourcesGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task IotConnectorsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateLinkResourceDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnector.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 IotConnectorsCreateOrUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnector.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -6093,18 +6883,19 @@ public partial class HealthcareApis } /// - /// 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 subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of the service instance. - /// The name of the private link resource group. + /// The name of workspace resource. + /// The name of IoT Connector resource. + /// The parameters for creating or updating an IoT Connectors 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 PrivateLinkResourcesGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, string groupName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task IotConnectorsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -6112,19 +6903,25 @@ public partial class HealthcareApis await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); - await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); - await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); + await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); + await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); + await eventListener.AssertNotNull(nameof(iotConnectorName),iotConnectorName); + await eventListener.AssertMinimumLength(nameof(iotConnectorName),iotConnectorName,3); + await eventListener.AssertMaximumLength(nameof(iotConnectorName),iotConnectorName,24); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Gets the private link resources that need to be created for a service. + /// Deletes an IoT Connector. /// The subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of the service instance. + /// The name of IoT Connector resource. + /// The name of workspace 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. @@ -6132,7 +6929,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkResourcesListByService(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorsDelete(string subscriptionId, string resourceGroupName, string iotConnectorName, string workspaceName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -6144,9 +6941,10 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HealthcareApis/services/" - + global::System.Uri.EscapeDataString(resourceName) - + "/privateLinkResources" + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6155,18 +6953,19 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkResourcesListByService_Call(request,onOk,onDefault,eventListener,sender); + await this.IotConnectorsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Gets the private link resources that need to be created for a service. + /// Deletes an IoT Connector. /// /// 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. @@ -6174,7 +6973,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkResourcesListByServiceViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorsDeleteViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -6182,25 +6981,27 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/services/(?[^/]+)/privateLinkResources$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}/privateLinkResources'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; + var iotConnectorName = _match.Groups["iotConnectorName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HealthcareApis/services/" - + resourceName - + "/privateLinkResources" + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/iotconnectors/" + + iotConnectorName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6209,18 +7010,19 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkResourcesListByService_Call(request,onOk,onDefault,eventListener,sender); + await this.IotConnectorsDelete_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. @@ -6228,17 +7030,114 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateLinkResourcesListByService_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task IotConnectorsDelete_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -6246,13 +7145,19 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateLinkResourceListResultDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -6268,17 +7173,18 @@ public partial class HealthcareApis } /// - /// 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 subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of the service instance. + /// The name of IoT Connector resource. + /// The name of workspace 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 PrivateLinkResourcesListByService_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task IotConnectorsDelete_Validate(string subscriptionId, string resourceGroupName, string iotConnectorName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -6286,17 +7192,21 @@ public partial class HealthcareApis await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); - await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(iotConnectorName),iotConnectorName); + await eventListener.AssertMinimumLength(nameof(iotConnectorName),iotConnectorName,3); + await eventListener.AssertMaximumLength(nameof(iotConnectorName),iotConnectorName,24); + await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); + await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); + await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); } } - /// Check if a service instance name is available. + /// Gets the properties of the specified IoT Connector. /// The subscription identifier. - /// Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service - /// instance to check. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of IoT Connector 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). @@ -6305,7 +7215,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicesCheckNameAvailability(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorsGet(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -6315,7 +7225,12 @@ public partial class HealthcareApis var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HealthcareApis/checkNameAvailability" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6324,23 +7239,17 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicesCheckNameAvailability_Call(request,onOk,onDefault,eventListener,sender); + await this.IotConnectorsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Check if a service instance name is available. + /// Gets the properties of the specified IoT Connector. /// - /// Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service - /// instance to check. /// a delegate that is 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). @@ -6349,7 +7258,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicesCheckNameAvailabilityViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorsGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -6357,19 +7266,27 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.HealthcareApis$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + var iotConnectorName = _match.Groups["iotConnectorName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.HealthcareApis/checkNameAvailability" + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/iotconnectors/" + + iotConnectorName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6378,20 +7295,174 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicesCheckNameAvailability_Call(request,onOk,onDefault,eventListener,sender); + await this.IotConnectorsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the properties of the specified IoT Connector. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 IotConnectorsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + var iotConnectorName = _match.Groups["iotConnectorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/iotconnectors/" + + iotConnectorName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.IotConnectorsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the properties of the specified IoT Connector. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of IoT Connector resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 IotConnectorsGetWithResult(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.IotConnectorsGetWithResult_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.HealthcareApis.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 IotConnectorsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnector.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 @@ -6401,7 +7472,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ServicesCheckNameAvailability_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task IotConnectorsGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -6412,6 +7483,7 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -6419,13 +7491,13 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesNameAvailabilityInfo.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnector.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -6441,31 +7513,39 @@ public partial class HealthcareApis } /// - /// 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 subscription identifier. - /// Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service - /// instance to check. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of IoT Connector 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 ServicesCheckNameAvailability_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task IotConnectorsGet_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string iotConnectorName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); + await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); + await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); + await eventListener.AssertNotNull(nameof(iotConnectorName),iotConnectorName); + await eventListener.AssertMinimumLength(nameof(iotConnectorName),iotConnectorName,3); + await eventListener.AssertMaximumLength(nameof(iotConnectorName),iotConnectorName,24); } } - /// Create or update the metadata of a service instance. + /// Lists all IoT Connectors for the given workspace /// The subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of the service instance. - /// The service instance metadata. + /// The name of workspace 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). @@ -6474,7 +7554,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicesCreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorsListByWorkspace(string subscriptionId, string resourceGroupName, string workspaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -6486,8 +7566,9 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HealthcareApis/services/" - + global::System.Uri.EscapeDataString(resourceName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6496,22 +7577,17 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.IotConnectorsListByWorkspace_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create or update the metadata of a service instance. + /// Lists all IoT Connectors for the given workspace /// - /// The service instance metadata. /// a delegate that is 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). @@ -6520,7 +7596,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorsListByWorkspaceViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -6528,24 +7604,25 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/services/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/iotconnectors$", 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.HealthcareApis/services/{resourceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HealthcareApis/services/" - + resourceName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/iotconnectors" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6554,139 +7631,193 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.IotConnectorsListByWorkspace_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 IoT Connectors for the given workspace + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesCreateOrUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorsListByWorkspaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)/iotconnectors$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis/workspaces/{workspaceName}/iotconnectors'"); + } - // 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.HealthcareApis.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 workspaceName = _match.Groups["workspaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/iotconnectors" + + "?" + + "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.IotConnectorsListByWorkspaceWithResult_Call (request, eventListener,sender); + } + } + + /// Lists all IoT Connectors for the given workspace + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 IotConnectorsListByWorkspaceWithResult(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.IotConnectorsListByWorkspaceWithResult_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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 IotConnectorsListByWorkspaceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnectorCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 IotConnectorsListByWorkspace_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -6694,13 +7825,13 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnectorCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -6716,18 +7847,17 @@ public partial class HealthcareApis } /// - /// 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 subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of the service instance. - /// The service instance metadata. + /// The name of workspace 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 ServicesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task IotConnectorsListByWorkspace_Validate(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -6735,29 +7865,29 @@ public partial class HealthcareApis await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); - await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); + await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); + await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); } } - /// Delete a service instance. + /// Patch an IoT Connector. /// The subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of the service instance. + /// The name of IoT Connector resource. + /// The name of workspace resource. + /// The parameters for updating an IoT Connector. /// 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.HealthcareApis.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 ServicesDelete(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorsUpdate(string subscriptionId, string resourceGroupName, string iotConnectorName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPatchResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -6769,8 +7899,10 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HealthcareApis/services/" - + global::System.Uri.EscapeDataString(resourceName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6779,27 +7911,32 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.IotConnectorsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete a service instance. + /// Patch an IoT Connector. /// + /// The parameters for updating an IoT Connector. /// 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.HealthcareApis.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 ServicesDeleteViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPatchResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -6807,24 +7944,27 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/services/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; + var iotConnectorName = _match.Groups["iotConnectorName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HealthcareApis/services/" - + resourceName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/iotconnectors/" + + iotConnectorName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6833,69 +7973,7187 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.IotConnectorsUpdate_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). + /// Patch an IoT Connector. + /// + /// The parameters for updating an IoT Connector. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesDelete_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task IotConnectorsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPatchResource body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)/iotconnectors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}'"); + } - // 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.HealthcareApis.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 iotConnectorName = _match.Groups["iotConnectorName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/iotconnectors/" + + iotConnectorName + + "?" + + "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.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // while we wait, let's grab the headers and get ready to poll. + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.IotConnectorsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Patch an IoT Connector. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of IoT Connector resource. + /// The name of workspace resource. + /// Json string supplied to the IotConnectorsUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 IotConnectorsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string iotConnectorName, string workspaceName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IotConnectorsUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Patch an IoT Connector. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of IoT Connector resource. + /// The name of workspace resource. + /// Json string supplied to the IotConnectorsUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 IotConnectorsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string iotConnectorName, string workspaceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.IotConnectorsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Patch an IoT Connector. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of IoT Connector resource. + /// The name of workspace resource. + /// The parameters for updating an IoT Connector. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 IotConnectorsUpdateWithResult(string subscriptionId, string resourceGroupName, string iotConnectorName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPatchResource body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/iotconnectors/" + + global::System.Uri.EscapeDataString(iotConnectorName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.IotConnectorsUpdateWithResult_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.HealthcareApis.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 IotConnectorsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnector.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 IotConnectorsUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnector.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of IoT Connector resource. + /// The name of workspace resource. + /// The parameters for updating an IoT Connector. + /// 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 IotConnectorsUpdate_Validate(string subscriptionId, string resourceGroupName, string iotConnectorName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPatchResource body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(iotConnectorName),iotConnectorName); + await eventListener.AssertMinimumLength(nameof(iotConnectorName),iotConnectorName,3); + await eventListener.AssertMaximumLength(nameof(iotConnectorName),iotConnectorName,24); + await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); + await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); + await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get the operation result for a long running operation. + /// The subscription identifier. + /// The location of the operation. + /// The ID of the operation result to get. + /// a delegate that is 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.HealthcareApis.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 OperationResultsGet(string subscriptionId, string locationName, string operationResultId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.HealthcareApis/locations/" + + global::System.Uri.EscapeDataString(locationName) + + "/operationresults/" + + global::System.Uri.EscapeDataString(operationResultId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationResultsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the operation result for a long running operation. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 OperationResultsGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/locations/(?[^/]+)/operationresults/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/operationresults/{operationResultId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var locationName = _match.Groups["locationName"].Value; + var operationResultId = _match.Groups["operationResultId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.HealthcareApis/locations/" + + locationName + + "/operationresults/" + + operationResultId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationResultsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the operation result for a long running operation. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 OperationResultsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/locations/(?[^/]+)/operationresults/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/operationresults/{operationResultId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var locationName = _match.Groups["locationName"].Value; + var operationResultId = _match.Groups["operationResultId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.HealthcareApis/locations/" + + locationName + + "/operationresults/" + + operationResultId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationResultsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the operation result for a long running operation. + /// The subscription identifier. + /// The location of the operation. + /// The ID of the operation result to get. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 OperationResultsGetWithResult(string subscriptionId, string locationName, string operationResultId, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.HealthcareApis/locations/" + + global::System.Uri.EscapeDataString(locationName) + + "/operationresults/" + + global::System.Uri.EscapeDataString(operationResultId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationResultsGetWithResult_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.HealthcareApis.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 OperationResultsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationResultsDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 OperationResultsGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationResultsDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The subscription identifier. + /// The location of the operation. + /// The ID of the operation result to get. + /// 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 OperationResultsGet_Validate(string subscriptionId, string locationName, string operationResultId, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(locationName),locationName); + await eventListener.AssertNotNull(nameof(operationResultId),operationResultId); + } + } + + /// + /// Lists all of the available operations supported by Microsoft Healthcare resource provider. + /// + /// a delegate that is 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.HealthcareApis.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 OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.HealthcareApis/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists all of the available operations supported by Microsoft Healthcare resource provider. + /// + /// + /// a delegate that is 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.HealthcareApis.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 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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.HealthcareApis/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.HealthcareApis/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists all of the available operations supported by Microsoft Healthcare resource provider. + /// + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.HealthcareApis/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.HealthcareApis/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Lists all of the available operations supported by Microsoft Healthcare resource provider. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListWithResult(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.HealthcareApis/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ListOperations.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ListOperations.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. + /// + /// 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.HealthcareApis.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + + } + } + + /// + /// update the state of the specified private endpoint connection associated with the service. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The name of the private endpoint connection associated with the Azure resource + /// The private endpoint connection properties. + /// a delegate that is 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.HealthcareApis.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 PrivateEndpointConnectionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update the state of the specified private endpoint connection associated with the service. + /// + /// + /// The private endpoint connection properties. + /// a delegate that is 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.HealthcareApis.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 PrivateEndpointConnectionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services/" + + resourceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update the state of the specified private endpoint connection associated with the service. + /// + /// + /// The private endpoint connection properties. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 PrivateEndpointConnectionsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services/" + + resourceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateEndpointConnectionsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update the state of the specified private endpoint connection associated with the service. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The name of the private endpoint connection associated with the Azure resource + /// Json string supplied to the PrivateEndpointConnectionsCreateOrUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 PrivateEndpointConnectionsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update the state of the specified private endpoint connection associated with the service. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The name of the private endpoint connection associated with the Azure resource + /// Json string supplied to the PrivateEndpointConnectionsCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 PrivateEndpointConnectionsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateEndpointConnectionsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update the state of the specified private endpoint connection associated with the service. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The name of the private endpoint connection associated with the Azure resource + /// The private endpoint connection properties. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 PrivateEndpointConnectionsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateEndpointConnectionsCreateOrUpdateWithResult_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.HealthcareApis.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 PrivateEndpointConnectionsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 PrivateEndpointConnectionsCreateOrUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The name of the private endpoint connection associated with the Azure resource + /// The private endpoint connection properties. + /// 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 PrivateEndpointConnectionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes a private endpoint connection. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The name of the private endpoint connection associated with the Azure 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.HealthcareApis.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 PrivateEndpointConnectionsDelete(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes a private endpoint connection. + /// + /// 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.HealthcareApis.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 PrivateEndpointConnectionsDeleteViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services/" + + resourceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsDelete_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.HealthcareApis.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 PrivateEndpointConnectionsDelete_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The name of the private endpoint connection associated with the Azure 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 PrivateEndpointConnectionsDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + } + } + + /// Gets the specified private endpoint connection associated with the service. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The name of the private endpoint connection associated with the Azure 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.HealthcareApis.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 PrivateEndpointConnectionsGet(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the specified private endpoint connection associated with the 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.HealthcareApis.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 PrivateEndpointConnectionsGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services/" + + resourceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the specified private endpoint connection associated with the service. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 PrivateEndpointConnectionsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services/" + + resourceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateEndpointConnectionsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the specified private endpoint connection associated with the service. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The name of the private endpoint connection associated with the Azure resource + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 PrivateEndpointConnectionsGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateEndpointConnectionsGetWithResult_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.HealthcareApis.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 PrivateEndpointConnectionsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 PrivateEndpointConnectionsGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The name of the private endpoint connection associated with the Azure 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 PrivateEndpointConnectionsGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + } + } + + /// Lists all private endpoint connections for a service. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// a delegate that is 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.HealthcareApis.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 PrivateEndpointConnectionsListByService(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsListByService_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists all private endpoint connections for a 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.HealthcareApis.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 PrivateEndpointConnectionsListByServiceViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)/privateEndpointConnections$", 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.HealthcareApis/services/{resourceName}/privateEndpointConnections'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services/" + + resourceName + + "/privateEndpointConnections" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsListByService_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists all private endpoint connections for a service. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 PrivateEndpointConnectionsListByServiceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)/privateEndpointConnections$", 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.HealthcareApis/services/{resourceName}/privateEndpointConnections'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services/" + + resourceName + + "/privateEndpointConnections" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateEndpointConnectionsListByServiceWithResult_Call (request, eventListener,sender); + } + } + + /// Lists all private endpoint connections for a service. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 PrivateEndpointConnectionsListByServiceWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateEndpointConnectionsListByServiceWithResult_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.HealthcareApis.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 PrivateEndpointConnectionsListByServiceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionListResultDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 PrivateEndpointConnectionsListByService_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionListResultDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// 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 PrivateEndpointConnectionsListByService_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); + } + } + + /// Gets a private link resource that need to be created for a service. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The name of the private link 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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 PrivateLinkResourcesGet(string subscriptionId, string resourceGroupName, string resourceName, string groupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateLinkResources/" + + global::System.Uri.EscapeDataString(groupName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateLinkResourcesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets a private link resource that need to be created for a 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.HealthcareApis.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 PrivateLinkResourcesGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)/privateLinkResources/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}/privateLinkResources/{groupName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var groupName = _match.Groups["groupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services/" + + resourceName + + "/privateLinkResources/" + + groupName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateLinkResourcesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets a private link resource that need to be created for a service. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 PrivateLinkResourcesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)/privateLinkResources/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}/privateLinkResources/{groupName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var groupName = _match.Groups["groupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services/" + + resourceName + + "/privateLinkResources/" + + groupName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateLinkResourcesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Gets a private link resource that need to be created for a service. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The name of the private link resource group. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 PrivateLinkResourcesGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, string groupName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateLinkResources/" + + global::System.Uri.EscapeDataString(groupName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateLinkResourcesGetWithResult_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.HealthcareApis.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 PrivateLinkResourcesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourceDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 PrivateLinkResourcesGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourceDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The name of the private link resource 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 PrivateLinkResourcesGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, string groupName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); + await eventListener.AssertNotNull(nameof(groupName),groupName); + } + } + + /// Gets the private link resources that need to be created for a service. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// a delegate that is 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.HealthcareApis.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 PrivateLinkResourcesListByService(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateLinkResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateLinkResourcesListByService_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the private link resources that need to be created for a 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.HealthcareApis.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 PrivateLinkResourcesListByServiceViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)/privateLinkResources$", 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.HealthcareApis/services/{resourceName}/privateLinkResources'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services/" + + resourceName + + "/privateLinkResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateLinkResourcesListByService_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the private link resources that need to be created for a service. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 PrivateLinkResourcesListByServiceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)/privateLinkResources$", 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.HealthcareApis/services/{resourceName}/privateLinkResources'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services/" + + resourceName + + "/privateLinkResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateLinkResourcesListByServiceWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the private link resources that need to be created for a service. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 PrivateLinkResourcesListByServiceWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateLinkResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateLinkResourcesListByServiceWithResult_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.HealthcareApis.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 PrivateLinkResourcesListByServiceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourceListResultDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 PrivateLinkResourcesListByService_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourceListResultDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// 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 PrivateLinkResourcesListByService_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); + } + } + + /// Check if a service instance name is available. + /// The subscription identifier. + /// Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service + /// instance to check. + /// a delegate that is 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.HealthcareApis.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 ServicesCheckNameAvailability(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.HealthcareApis/checkNameAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesCheckNameAvailability_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Check if a service instance name is available. + /// + /// Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service + /// instance to check. + /// a delegate that is 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.HealthcareApis.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 ServicesCheckNameAvailabilityViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis'"); + } + + // 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.HealthcareApis/checkNameAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesCheckNameAvailability_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Check if a service instance name is available. + /// + /// Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service + /// instance to check. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesCheckNameAvailabilityViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis'"); + } + + // 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.HealthcareApis/checkNameAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicesCheckNameAvailabilityWithResult_Call (request, eventListener,sender); + } + } + + /// Check if a service instance name is available. + /// The subscription identifier. + /// Json string supplied to the ServicesCheckNameAvailability operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesCheckNameAvailabilityViaJsonString(string subscriptionId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.HealthcareApis/checkNameAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesCheckNameAvailability_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Check if a service instance name is available. + /// The subscription identifier. + /// Json string supplied to the ServicesCheckNameAvailability operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesCheckNameAvailabilityViaJsonStringWithResult(string subscriptionId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.HealthcareApis/checkNameAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicesCheckNameAvailabilityWithResult_Call (request, eventListener,sender); + } + } + + /// Check if a service instance name is available. + /// The subscription identifier. + /// Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service + /// instance to check. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesCheckNameAvailabilityWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.HealthcareApis/checkNameAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicesCheckNameAvailabilityWithResult_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.HealthcareApis.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 ServicesCheckNameAvailabilityWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesNameAvailabilityInfo.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 ServicesCheckNameAvailability_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesNameAvailabilityInfo.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The subscription identifier. + /// Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service + /// instance to check. + /// 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 ServicesCheckNameAvailability_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// update the metadata of a service instance. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The service instance metadata. + /// a delegate that is 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.HealthcareApis.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 ServicesCreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update the metadata of a service instance. + /// + /// The service instance metadata. + /// a delegate that is 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.HealthcareApis.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 ServicesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update the metadata of a service instance. + /// + /// The service instance metadata. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicesCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update the metadata of a service instance. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// Json string supplied to the ServicesCreateOrUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update the metadata of a service instance. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// Json string supplied to the ServicesCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicesCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update the metadata of a service instance. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The service instance metadata. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicesCreateOrUpdateWithResult_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.HealthcareApis.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 ServicesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 ServicesCreateOrUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The service instance metadata. + /// 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 ServicesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete a service instance. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// 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.HealthcareApis.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 ServicesDelete(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete a service instance. + /// + /// 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.HealthcareApis.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 ServicesDeleteViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesDelete_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.HealthcareApis.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 ServicesDelete_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// 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 ServicesDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); + } + } + + /// Get the metadata of a service instance. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// a delegate that is 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.HealthcareApis.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 ServicesGet(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the metadata of a service instance. + /// + /// a delegate that is 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.HealthcareApis.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 ServicesGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the metadata of a service instance. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the metadata of a service instance. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicesGetWithResult_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.HealthcareApis.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 ServicesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 ServicesGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// 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 ServicesGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); + } + } + + /// Get all the service instances in a subscription. + /// The subscription 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.HealthcareApis.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 ServicesList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.HealthcareApis/services" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get all the service instances in a resource group. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// a delegate that is 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.HealthcareApis.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 ServicesListByResourceGroup(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get all the service instances 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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesListByResourceGroupViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services$", 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.HealthcareApis/services'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get all the service instances in a resource group. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services$", 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.HealthcareApis/services'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicesListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Get all the service instances in a resource group. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicesListByResourceGroupWithResult_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.HealthcareApis.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 ServicesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesDescriptionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 ServicesListByResourceGroup_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesDescriptionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// 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 ServicesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + } + } + + /// Get all the service instances in a subscription. + /// + /// a delegate that is 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.HealthcareApis.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 ServicesListViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/services'"); + } + + // 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.HealthcareApis/services" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get all the service instances in a subscription. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/services'"); + } + + // 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.HealthcareApis/services" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicesListWithResult_Call (request, eventListener,sender); + } + } + + /// Get all the service instances in a subscription. + /// The subscription identifier. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesListWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.HealthcareApis/services" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicesListWithResult_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.HealthcareApis.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 ServicesListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesDescriptionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 ServicesList_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesDescriptionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The subscription 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 ServicesList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// update the metadata of a service instance. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The service instance metadata and security metadata. + /// a delegate that is 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.HealthcareApis.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 ServicesUpdate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update the metadata of a service instance. + /// + /// The service instance metadata and security metadata. + /// a delegate that is 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.HealthcareApis.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 ServicesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update the metadata of a service instance. + /// + /// The service instance metadata and security metadata. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescription body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/services/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update the metadata of a service instance. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// Json string supplied to the ServicesUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update the metadata of a service instance. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// Json string supplied to the ServicesUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update the metadata of a service instance. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The service instance metadata and security metadata. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesUpdateWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescription body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/services/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicesUpdateWithResult_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.HealthcareApis.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 ServicesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 ServicesUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of the service instance. + /// The service instance metadata and security metadata. + /// 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 ServicesUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescription body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// update the state of the specified private endpoint connection associated with the workspace. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of the private endpoint connection associated with the Azure resource + /// The private endpoint connection properties. + /// a delegate that is 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.HealthcareApis.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 WorkspacePrivateEndpointConnectionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePrivateEndpointConnectionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update the state of the specified private endpoint connection associated with the workspace. + /// + /// + /// The private endpoint connection properties. + /// a delegate that is 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.HealthcareApis.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 WorkspacePrivateEndpointConnectionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePrivateEndpointConnectionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update the state of the specified private endpoint connection associated with the workspace. + /// + /// + /// The private endpoint connection properties. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacePrivateEndpointConnectionsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkspacePrivateEndpointConnectionsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update the state of the specified private endpoint connection associated with the workspace. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of the private endpoint connection associated with the Azure resource + /// Json string supplied to the WorkspacePrivateEndpointConnectionsCreateOrUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacePrivateEndpointConnectionsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePrivateEndpointConnectionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update the state of the specified private endpoint connection associated with the workspace. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of the private endpoint connection associated with the Azure resource + /// Json string supplied to the WorkspacePrivateEndpointConnectionsCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacePrivateEndpointConnectionsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkspacePrivateEndpointConnectionsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update the state of the specified private endpoint connection associated with the workspace. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of the private endpoint connection associated with the Azure resource + /// The private endpoint connection properties. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacePrivateEndpointConnectionsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkspacePrivateEndpointConnectionsCreateOrUpdateWithResult_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.HealthcareApis.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 WorkspacePrivateEndpointConnectionsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 WorkspacePrivateEndpointConnectionsCreateOrUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of the private endpoint connection associated with the Azure resource + /// The private endpoint connection properties. + /// 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 WorkspacePrivateEndpointConnectionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); + await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); + await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes a private endpoint connection. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of the private endpoint connection associated with the Azure 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.HealthcareApis.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 WorkspacePrivateEndpointConnectionsDelete(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePrivateEndpointConnectionsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes a private endpoint connection. + /// + /// 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.HealthcareApis.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 WorkspacePrivateEndpointConnectionsDeleteViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePrivateEndpointConnectionsDelete_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.HealthcareApis.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 WorkspacePrivateEndpointConnectionsDelete_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); @@ -6904,45 +15162,45 @@ public partial class HealthcareApis _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -6964,6 +15222,7 @@ public partial class HealthcareApis break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -6983,7 +15242,7 @@ public partial class HealthcareApis default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -6999,17 +15258,18 @@ public partial class HealthcareApis } /// - /// 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 subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of the service instance. + /// The name of workspace resource. + /// The name of the private endpoint connection associated with the Azure 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 ServicesDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkspacePrivateEndpointConnectionsDelete_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -7017,26 +15277,182 @@ public partial class HealthcareApis await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); - await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); + await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); + await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + } + } + + /// Gets the specified private endpoint connection associated with the workspace. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The name of the private endpoint connection associated with the Azure 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.HealthcareApis.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 WorkspacePrivateEndpointConnectionsGet(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePrivateEndpointConnectionsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the specified private endpoint connection associated with the workspace. + /// + /// a delegate that is 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.HealthcareApis.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 WorkspacePrivateEndpointConnectionsGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePrivateEndpointConnectionsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the specified private endpoint connection associated with the workspace. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacePrivateEndpointConnectionsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkspacePrivateEndpointConnectionsGetWithResult_Call (request, eventListener,sender); } } - /// Get the metadata of a service instance. + /// Gets the specified private endpoint connection associated with the workspace. /// The subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of the service instance. - /// a delegate that is 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 name of workspace resource. + /// The name of the private endpoint connection associated with the Azure resource /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesGet(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacePrivateEndpointConnectionsGetWithResult(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -7048,79 +15464,92 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HealthcareApis/services/" - + global::System.Uri.EscapeDataString(resourceName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ServicesGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkspacePrivateEndpointConnectionsGetWithResult_Call (request, eventListener,sender); } } - /// Get the metadata of a service instance. - /// - /// a delegate that is 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.HealthcareApis.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 ServicesGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkspacePrivateEndpointConnectionsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { - var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis/services/(?[^/]+)$", 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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis/services/{resourceName}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 resourceName = _match.Groups["resourceName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HealthcareApis/services/" - + resourceName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ServicesGet_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 @@ -7130,7 +15559,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ServicesGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkspacePrivateEndpointConnectionsGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -7141,6 +15570,7 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -7148,13 +15578,13 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -7170,17 +15600,18 @@ public partial class HealthcareApis } /// - /// 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 subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of the service instance. + /// The name of workspace resource. + /// The name of the private endpoint connection associated with the Azure 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 ServicesGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkspacePrivateEndpointConnectionsGet_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -7188,15 +15619,18 @@ public partial class HealthcareApis await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); - await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); + await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); + await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); } } - /// Get all the service instances in a subscription. + /// Lists all private endpoint connections for a workspace. /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace 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). @@ -7205,7 +15639,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicesList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacePrivateEndpointConnectionsListByWorkspace(string subscriptionId, string resourceGroupName, string workspaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -7215,7 +15649,11 @@ public partial class HealthcareApis var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HealthcareApis/services" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/privateEndpointConnections" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7229,13 +15667,12 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicesList_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkspacePrivateEndpointConnectionsListByWorkspace_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get all the service instances in a resource group. - /// The subscription identifier. - /// The name of the resource group that contains the service instance. + /// Lists all private endpoint connections for a workspace. + /// /// a delegate that is 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). @@ -7244,19 +15681,33 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicesListByResourceGroup(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacePrivateEndpointConnectionsListByWorkspaceViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)/privateEndpointConnections$", 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.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].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.HealthcareApis/services" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/privateEndpointConnections" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7270,21 +15721,19 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkspacePrivateEndpointConnectionsListByWorkspace_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get all the service instances in a resource group. + /// Lists all private endpoint connections for a workspace. /// - /// a delegate that is 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.HealthcareApis.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 ServicesListByResourceGroupViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacePrivateEndpointConnectionsListByWorkspaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -7292,159 +15741,149 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/services$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/privateEndpointConnections$", 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.HealthcareApis/services'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HealthcareApis/services" + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/privateEndpointConnections" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ServicesListByResourceGroup_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.HealthcareApis.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 ServicesListByResourceGroup_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesDescriptionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + return await this.WorkspacePrivateEndpointConnectionsListByWorkspaceWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// + /// Lists all private endpoint connections for a workspace. /// The subscription identifier. /// The name of the resource group that contains the service instance. + /// The name of workspace 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 ServicesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - } - } - - /// Get all the service instances in a subscription. - /// - /// a delegate that is 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.HealthcareApis.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 ServicesListViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-11-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.HealthcareApis/services$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/services'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacePrivateEndpointConnectionsListByWorkspaceWithResult(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId - + "/providers/Microsoft.HealthcareApis/services" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/privateEndpointConnections" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ServicesList_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkspacePrivateEndpointConnectionsListByWorkspaceWithResult_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.HealthcareApis.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 WorkspacePrivateEndpointConnectionsListByWorkspaceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionListResultDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 @@ -7454,7 +15893,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ServicesList_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkspacePrivateEndpointConnectionsListByWorkspace_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -7465,6 +15904,7 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -7472,13 +15912,13 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesDescriptionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionListResultDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -7494,27 +15934,36 @@ public partial class HealthcareApis } /// - /// 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 subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace 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 ServicesList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkspacePrivateEndpointConnectionsListByWorkspace_Validate(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); + await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); + await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); } } - /// Update the metadata of a service instance. + /// Gets a private link resource that need to be created for a workspace. /// The subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of the service instance. - /// The service instance metadata and security metadata. + /// The name of workspace resource. + /// The name of the private link 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). @@ -7523,7 +15972,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicesUpdate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacePrivateLinkResourcesGet(string subscriptionId, string resourceGroupName, string workspaceName, string groupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -7535,8 +15984,10 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HealthcareApis/services/" - + global::System.Uri.EscapeDataString(resourceName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/privateLinkResources/" + + global::System.Uri.EscapeDataString(groupName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7545,22 +15996,17 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkspacePrivateLinkResourcesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Update the metadata of a service instance. + /// Gets a private link resource that need to be created for a workspace. /// - /// The service instance metadata and security metadata. /// a delegate that is 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). @@ -7569,7 +16015,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacePrivateLinkResourcesGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -7577,24 +16023,27 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/services/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/privateLinkResources/(?[^/]+)$", 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.HealthcareApis/services/{resourceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateLinkResources/{groupName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + var groupName = _match.Groups["groupName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HealthcareApis/services/" - + resourceName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/privateLinkResources/" + + groupName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7603,213 +16052,81 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkspacePrivateLinkResourcesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Gets a private link resource that need to be created for a workspace. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServicesUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacePrivateLinkResourcesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { + var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Method.Get); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/privateLinkResources/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/privateLinkResources/{groupName}'"); + } - // 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 workspaceName = _match.Groups["workspaceName"].Value; + var groupName = _match.Groups["groupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/privateLinkResources/" + + groupName + + "?" + + "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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 subscription identifier. - /// The name of the resource group that contains the service instance. - /// The name of the service instance. - /// The service instance metadata and security metadata. - /// 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 ServicesUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescription body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,3); - await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,24); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkspacePrivateLinkResourcesGetWithResult_Call (request, eventListener,sender); } } - /// - /// Update the state of the specified private endpoint connection associated with the workspace. - /// + /// Gets a private link resource that need to be created for a workspace. /// The subscription identifier. /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The name of the private endpoint connection associated with the Azure resource - /// The private endpoint connection properties. - /// a delegate that is 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 name of the private link resource group. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacePrivateEndpointConnectionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacePrivateLinkResourcesGetWithResult(string subscriptionId, string resourceGroupName, string workspaceName, string groupName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -7823,95 +16140,88 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/privateEndpointConnections/" - + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "/privateLinkResources/" + + global::System.Uri.EscapeDataString(groupName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkspacePrivateEndpointConnectionsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkspacePrivateLinkResourcesGetWithResult_Call (request, eventListener,sender); } } /// - /// Update the state of the specified private endpoint connection associated with the workspace. + /// Actual wire call for method. /// - /// - /// The private endpoint connection properties. - /// a delegate that is 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.HealthcareApis.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 WorkspacePrivateEndpointConnectionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkspacePrivateLinkResourcesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { - var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis/workspaces/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", 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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourceDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 workspaceName = _match.Groups["workspaceName"].Value; - var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HealthcareApis/workspaces/" - + workspaceName - + "/privateEndpointConnections/" - + privateEndpointConnectionName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.WorkspacePrivateEndpointConnectionsCreateOrUpdate_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 @@ -7921,7 +16231,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkspacePrivateEndpointConnectionsCreateOrUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkspacePrivateLinkResourcesGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -7932,105 +16242,7 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -8038,13 +16250,13 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateEndpointConnectionDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourceDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -8060,19 +16272,18 @@ public partial class HealthcareApis } /// - /// 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 subscription identifier. /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The name of the private endpoint connection associated with the Azure resource - /// The private endpoint connection properties. + /// The name of the private link resource 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 WorkspacePrivateEndpointConnectionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkspacePrivateLinkResourcesGet_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string groupName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -8080,23 +16291,19 @@ public partial class HealthcareApis await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(groupName),groupName); } } - /// Deletes a private endpoint connection. + /// Gets the private link resources that need to be created for a workspace. /// The subscription identifier. /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The name of the private endpoint connection associated with the Azure 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. @@ -8104,7 +16311,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkspacePrivateEndpointConnectionsDelete(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacePrivateLinkResourcesListByWorkspace(string subscriptionId, string resourceGroupName, string workspaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -8118,8 +16325,7 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/privateEndpointConnections/" - + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "/privateLinkResources" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8128,19 +16334,18 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkspacePrivateEndpointConnectionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.WorkspacePrivateLinkResourcesListByWorkspace_Call (request, onOk,onDefault,eventListener,sender); } } - /// Deletes a private endpoint connection. + /// Gets the private link resources that need to be created for a workspace. /// /// 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. @@ -8148,7 +16353,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkspacePrivateEndpointConnectionsDeleteViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacePrivateLinkResourcesListByWorkspaceViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -8156,17 +16361,68 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/privateLinkResources$", 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.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateLinkResources'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "/privateLinkResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePrivateLinkResourcesListByWorkspace_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the private link resources that need to be created for a workspace. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacePrivateLinkResourcesListByWorkspaceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)/privateLinkResources$", 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.HealthcareApis/workspaces/{workspaceName}/privateLinkResources'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var workspaceName = _match.Groups["workspaceName"].Value; - var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -8174,40 +16430,78 @@ public partial class HealthcareApis + "/resourceGroups/" + resourceGroupName + "/providers/Microsoft.HealthcareApis/workspaces/" - + workspaceName - + "/privateEndpointConnections/" - + privateEndpointConnectionName + + workspaceName + + "/privateLinkResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkspacePrivateLinkResourcesListByWorkspaceWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the private link resources that need to be created for a workspace. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacePrivateLinkResourcesListByWorkspaceWithResult(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "/privateLinkResources" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkspacePrivateEndpointConnectionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.WorkspacePrivateLinkResourcesListByWorkspaceWithResult_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.HealthcareApis.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 WorkspacePrivateEndpointConnectionsDelete_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkspacePrivateLinkResourcesListByWorkspaceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -8215,109 +16509,74 @@ public partial class HealthcareApis try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.UndeclaredResponseException(_response); - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourceListResultDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 WorkspacePrivateLinkResourcesListByWorkspace_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -8325,19 +16584,13 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourceListResultDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -8353,18 +16606,17 @@ public partial class HealthcareApis } /// - /// Validation method for method. Call this like the actual call, + /// Validation method for method. Call this like the actual call, /// but you will get validation events back. /// /// The subscription identifier. /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The name of the private endpoint connection associated with the Azure 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 WorkspacePrivateEndpointConnectionsDelete_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkspacePrivateLinkResourcesListByWorkspace_Validate(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -8372,28 +16624,28 @@ public partial class HealthcareApis await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); } } - /// Gets the specified private endpoint connection associated with the workspace. + /// update a workspace resource with the specified parameters. /// The subscription identifier. /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The name of the private endpoint connection associated with the Azure resource + /// The parameters for creating or updating a healthcare workspace. /// a delegate that is 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.HealthcareApis.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 WorkspacePrivateEndpointConnectionsGet(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesCreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -8407,8 +16659,6 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/privateEndpointConnections/" - + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8417,26 +16667,32 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkspacePrivateEndpointConnectionsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkspacesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets the specified private endpoint connection associated with the workspace. + /// update a workspace resource with the specified parameters. /// + /// The parameters for creating or updating a healthcare workspace. /// a delegate that is 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.HealthcareApis.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 WorkspacePrivateEndpointConnectionsGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -8444,17 +16700,16 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var workspaceName = _match.Groups["workspaceName"].Value; - var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -8463,8 +16718,6 @@ public partial class HealthcareApis + resourceGroupName + "/providers/Microsoft.HealthcareApis/workspaces/" + workspaceName - + "/privateEndpointConnections/" - + privateEndpointConnectionName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8473,107 +16726,136 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkspacePrivateEndpointConnectionsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkspacesCreateOrUpdate_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 workspace resource with the specified parameters. + /// + /// The parameters for creating or updating a healthcare workspace. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacePrivateEndpointConnectionsGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateEndpointConnectionDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkspacesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. - /// + /// update a workspace resource with the specified parameters. /// The subscription identifier. /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The name of the private endpoint connection associated with the Azure resource + /// Json string supplied to the WorkspacesCreateOrUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacePrivateEndpointConnectionsGet_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task WorkspacesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string workspaceName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { + var apiVersion = @"2021-11-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); - await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); - await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Lists all private endpoint connections for a workspace. + /// update a workspace resource with the specified parameters. /// The subscription identifier. /// The name of the resource group that contains the service instance. /// The name of workspace 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). + /// Json string supplied to the WorkspacesCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacePrivateEndpointConnectionsListByWorkspace(string subscriptionId, string resourceGroupName, string workspaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string workspaceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -8587,116 +16869,216 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/privateEndpointConnections" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkspacePrivateEndpointConnectionsListByWorkspace_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkspacesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Lists all private endpoint connections for a workspace. - /// - /// a delegate that is 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 workspace resource with the specified parameters. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The parameters for creating or updating a healthcare workspace. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacePrivateEndpointConnectionsListByWorkspaceViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)/privateEndpointConnections$", 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.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var workspaceName = _match.Groups["workspaceName"].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.HealthcareApis/workspaces/" - + workspaceName - + "/privateEndpointConnections" + + global::System.Uri.EscapeDataString(workspaceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkspacePrivateEndpointConnectionsListByWorkspace_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkspacesCreateOrUpdateWithResult_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.HealthcareApis.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 WorkspacePrivateEndpointConnectionsListByWorkspace_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkspacesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateEndpointConnectionListResultDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Workspace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -8710,37 +17092,8 @@ public partial class HealthcareApis } } - /// - /// Validation method for method. Call this like the actual - /// call, but you will get validation events back. - /// - /// The subscription identifier. - /// The name of the resource group that contains the service instance. - /// The name of workspace 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 WorkspacePrivateEndpointConnectionsListByWorkspace_Validate(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); - await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); - await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - } - } - - /// Gets a private link resource that need to be created for a workspace. - /// The subscription identifier. - /// The name of the resource group that contains the service instance. - /// The name of workspace resource. - /// The name of the private link resource group. + /// 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). @@ -8749,116 +17102,113 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkspacePrivateLinkResourcesGet(string subscriptionId, string resourceGroupName, string workspaceName, string groupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkspacesCreateOrUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { - var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" - + global::System.Uri.EscapeDataString(workspaceName) - + "/privateLinkResources/" - + global::System.Uri.EscapeDataString(groupName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.WorkspacePrivateLinkResourcesGet_Call(request,onOk,onDefault,eventListener,sender); - } - } + // 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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get); - /// Gets a private link resource that need to be created for a workspace. - /// - /// a delegate that is 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.HealthcareApis.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 WorkspacePrivateLinkResourcesGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-11-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // 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(); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/privateLinkResources/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/privateLinkResources/{groupName}'"); - } + // 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 workspaceName = _match.Groups["workspaceName"].Value; - var groupName = _match.Groups["groupName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HealthcareApis/workspaces/" - + workspaceName - + "/privateLinkResources/" - + groupName - + "?" - + "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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); 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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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; - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.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.HealthcareApis.Runtime.UndeclaredResponseException(_response); + } + } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.WorkspacePrivateLinkResourcesGet_Call(request,onOk,onDefault,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.HealthcareApis.Runtime.Method.Get); - /// 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.HealthcareApis.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 WorkspacePrivateLinkResourcesGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -8866,13 +17216,13 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateLinkResourceDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Workspace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -8888,18 +17238,18 @@ public partial class HealthcareApis } /// - /// 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 subscription identifier. /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The name of the private link resource group. + /// The parameters for creating or updating a healthcare workspace. /// 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 WorkspacePrivateLinkResourcesGet_Validate(string subscriptionId, string resourceGroupName, string workspaceName, string groupName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkspacesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -8907,19 +17257,21 @@ public partial class HealthcareApis await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Gets the private link resources that need to be created for a workspace. + /// Deletes a specified workspace. /// The subscription identifier. /// The name of the resource group that contains the service instance. /// The name of workspace 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. @@ -8927,7 +17279,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkspacePrivateLinkResourcesListByWorkspace(string subscriptionId, string resourceGroupName, string workspaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesDelete(string subscriptionId, string resourceGroupName, string workspaceName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -8941,7 +17293,6 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces/" + global::System.Uri.EscapeDataString(workspaceName) - + "/privateLinkResources" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8950,18 +17301,19 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkspacePrivateLinkResourcesListByWorkspace_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkspacesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Gets the private link resources that need to be created for a workspace. + /// Deletes a specified workspace. /// /// 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. @@ -8969,7 +17321,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkspacePrivateLinkResourcesListByWorkspaceViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesDeleteViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -8977,10 +17329,10 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)/privateLinkResources$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}/privateLinkResources'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}'"); } // replace URI parameters with values from identity @@ -8995,7 +17347,6 @@ public partial class HealthcareApis + resourceGroupName + "/providers/Microsoft.HealthcareApis/workspaces/" + workspaceName - + "/privateLinkResources" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9004,20 +17355,19 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkspacePrivateLinkResourcesListByWorkspace_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkspacesDelete_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. @@ -9025,17 +17375,114 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkspacePrivateLinkResourcesListByWorkspace_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkspacesDelete_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -9043,13 +17490,19 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateLinkResourceListResultDescription.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -9065,8 +17518,8 @@ public partial class HealthcareApis } /// - /// 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 subscription identifier. /// The name of the resource group that contains the service instance. @@ -9075,7 +17528,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkspacePrivateLinkResourcesListByWorkspace_Validate(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkspacesDelete_Validate(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -9083,18 +17536,17 @@ public partial class HealthcareApis await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); } } - /// Creates or updates a workspace resource with the specified parameters. - /// The name of the resource group that contains the service instance. + /// Gets the properties of the specified workspace. /// The subscription identifier. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The parameters for creating or updating a healthcare workspace. /// a delegate that is 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). @@ -9103,7 +17555,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkspacesCreateOrUpdate(string resourceGroupName, string subscriptionId, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesGet(string subscriptionId, string resourceGroupName, string workspaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -9125,22 +17577,17 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkspacesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkspacesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Creates or updates a workspace resource with the specified parameters. + /// Gets the properties of the specified workspace. /// - /// The parameters for creating or updating a healthcare workspace. /// a delegate that is 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). @@ -9149,7 +17596,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkspacesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -9164,8 +17611,8 @@ public partial class HealthcareApis } // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; var workspaceName = _match.Groups["workspaceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( @@ -9183,139 +17630,189 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkspacesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkspacesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Gets the properties of the specified workspace. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacesCreateOrUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis/workspaces/{workspaceName}'"); + } - // 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.HealthcareApis.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 workspaceName = _match.Groups["workspaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + + "?" + + "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkspacesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the properties of the specified workspace. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacesGetWithResult(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkspacesGetWithResult_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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 WorkspacesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Workspace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 WorkspacesGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -9323,13 +17820,13 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.Workspace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Workspace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -9345,40 +17842,35 @@ public partial class HealthcareApis } /// - /// 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 name of the resource group that contains the service instance. /// The subscription identifier. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The parameters for creating or updating a healthcare workspace. /// 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 WorkspacesCreateOrUpdate_Validate(string resourceGroupName, string subscriptionId, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkspacesGet_Validate(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Deletes a specified workspace. + /// Lists all the available workspaces under the specified resource group. /// The subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of workspace 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. @@ -9386,7 +17878,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkspacesDelete(string subscriptionId, string resourceGroupName, string workspaceName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesListByResourceGroup(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -9398,8 +17890,7 @@ public partial class HealthcareApis + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HealthcareApis/workspaces/" - + global::System.Uri.EscapeDataString(workspaceName) + + "/providers/Microsoft.HealthcareApis/workspaces" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9408,19 +17899,18 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkspacesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.WorkspacesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// Deletes a specified workspace. + /// Lists all the available workspaces under the specified resource group. /// /// 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. @@ -9428,7 +17918,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkspacesDeleteViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesListByResourceGroupViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -9436,24 +17926,22 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces$", 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.HealthcareApis/workspaces/{workspaceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var workspaceName = _match.Groups["workspaceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HealthcareApis/workspaces/" - + workspaceName + + "/providers/Microsoft.HealthcareApis/workspaces" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9462,157 +17950,201 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkspacesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.WorkspacesListByResourceGroup_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). + /// Lists all the available workspaces under the specified resource group. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacesDelete_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis/workspaces'"); + } - // 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.HealthcareApis.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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces" + + "?" + + "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkspacesListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + /// Lists all the available workspaces under the specified resource group. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.UndeclaredResponseException(_response); - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkspacesListByResourceGroupWithResult_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.HealthcareApis.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 WorkspacesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.WorkspaceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 WorkspacesListByResourceGroup_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: + { + case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.WorkspaceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -9628,17 +18160,16 @@ public partial class HealthcareApis } /// - /// 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 subscription identifier. /// The name of the resource group that contains the service instance. - /// The name of workspace 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 WorkspacesDelete_Validate(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkspacesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -9646,17 +18177,12 @@ public partial class HealthcareApis await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); - await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); - await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); } } - /// Gets the properties of the specified workspace. - /// The name of the resource group that contains the service instance. + /// Lists all the available workspaces under the specified subscription. /// The subscription identifier. - /// The name of workspace 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). @@ -9665,7 +18191,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkspacesGet(string resourceGroupName, string subscriptionId, string workspaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -9675,10 +18201,7 @@ public partial class HealthcareApis var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HealthcareApis/workspaces/" - + global::System.Uri.EscapeDataString(workspaceName) + + "/providers/Microsoft.HealthcareApis/workspaces" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9692,11 +18215,11 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkspacesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkspacesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets the properties of the specified workspace. + /// Lists all the available workspaces under the specified subscription. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -9706,7 +18229,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkspacesGetViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesListBySubscriptionViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -9714,24 +18237,19 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces$", 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.HealthcareApis/workspaces/{workspaceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/workspaces'"); } // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; - var workspaceName = _match.Groups["workspaceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HealthcareApis/workspaces/" - + workspaceName + + "/providers/Microsoft.HealthcareApis/workspaces" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9745,97 +18263,65 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkspacesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkspacesListBySubscription_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 the available workspaces under the specified subscription. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacesGet_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { + var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.Workspace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/workspaces'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The name of the resource group that contains the service instance. - /// The subscription identifier. - /// The name of workspace 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 WorkspacesGet_Validate(string resourceGroupName, string subscriptionId, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); - await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); - await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); + // 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.HealthcareApis/workspaces" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkspacesListBySubscriptionWithResult_Call (request, eventListener,sender); } } - /// Lists all the available workspaces under the specified resource group. + /// Lists all the available workspaces under the specified subscription. /// The subscription identifier. - /// The name of the resource group that contains the service instance. - /// a delegate that is 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.HealthcareApis.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 WorkspacesListByResourceGroup(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -9845,78 +18331,87 @@ public partial class HealthcareApis var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HealthcareApis/workspaces" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkspacesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkspacesListBySubscriptionWithResult_Call (request, eventListener,sender); } } - /// Lists all the available workspaces under the specified 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). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacesListByResourceGroupViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkspacesListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { - var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis/workspaces$", 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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.WorkspaceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis/workspaces'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HealthcareApis/workspaces" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.WorkspacesListByResourceGroup_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 @@ -9926,7 +18421,7 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkspacesListByResourceGroup_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkspacesListBySubscription_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -9937,6 +18432,7 @@ public partial class HealthcareApis await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -9944,13 +18440,13 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.WorkspaceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.WorkspaceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -9966,48 +18462,109 @@ public partial class HealthcareApis } /// - /// 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 subscription identifier. - /// The name of the resource group that contains the service instance. /// 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 WorkspacesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkspacesListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); } } - /// Lists all the available workspaces under the specified subscription. + /// Patch workspace details. /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// The parameters for updating a specified workspace. + /// a delegate that is 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.HealthcareApis.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 WorkspacesUpdate(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePatchResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-11-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.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Patch workspace details. + /// + /// The parameters for updating a specified workspace. /// a delegate that is 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.HealthcareApis.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 WorkspacesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePatchResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HealthcareApis/workspaces" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10016,26 +18573,30 @@ public partial class HealthcareApis // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkspacesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkspacesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Lists all the available workspaces under the specified subscription. + /// Patch workspace details. /// - /// a delegate that is 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 parameters for updating a specified workspace. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacesListBySubscriptionViaIdentity(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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePatchResource body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -10043,38 +18604,50 @@ public partial class HealthcareApis { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HealthcareApis/workspaces/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/workspaces'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var workspaceName = _match.Groups["workspaceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.HealthcareApis/workspaces" + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HealthcareApis/workspaces/" + + workspaceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkspacesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkspacesUpdateWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. + /// Patch workspace details. + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. + /// Json string supplied to the WorkspacesUpdate operation /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -10083,76 +18656,53 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkspacesListBySubscription_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string workspaceName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { + var apiVersion = @"2021-11-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.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HealthcareApis/workspaces/" + + global::System.Uri.EscapeDataString(workspaceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.WorkspaceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The subscription 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 WorkspacesListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// Patch workspace details. - /// The name of the resource group that contains the service instance. /// The subscription identifier. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. - /// The parameters for updating a specified workspace. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Json string supplied to the WorkspacesUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 WorkspacesUpdate(string resourceGroupName, string subscriptionId, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1 body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string workspaceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { var apiVersion = @"2021-11-01"; // Constant Parameters @@ -10170,82 +18720,226 @@ public partial class HealthcareApis + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkspacesUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkspacesUpdateWithResult_Call (request, eventListener,sender); } } /// Patch workspace details. - /// + /// The subscription identifier. + /// The name of the resource group that contains the service instance. + /// The name of workspace resource. /// The parameters for updating a specified workspace. - /// a delegate that is 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.HealthcareApis.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 WorkspacesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1 body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkspacesUpdateWithResult(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePatchResource body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-11-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.HealthcareApis/workspaces/(?[^/]+)$", 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.HealthcareApis/workspaces/{workspaceName}'"); - } - - // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; - var workspaceName = _match.Groups["workspaceName"].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.HealthcareApis/workspaces/" - + workspaceName + + global::System.Uri.EscapeDataString(workspaceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkspacesUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkspacesUpdateWithResult_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.HealthcareApis.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 WorkspacesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Workspace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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 @@ -10255,31 +18949,28 @@ public partial class HealthcareApis /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkspacesUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkspacesUpdate_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.HealthcareApis.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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"); + var operationLocation = _response.GetFirstHeader(@"Operation-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.HealthcareApis.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.HealthcareApis.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"))) { @@ -10288,15 +18979,14 @@ public partial class HealthcareApis 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; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); @@ -10305,45 +18995,45 @@ public partial class HealthcareApis _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -10365,6 +19055,7 @@ public partial class HealthcareApis break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -10372,13 +19063,13 @@ public partial class HealthcareApis case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.Workspace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Workspace.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ErrorDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -10397,23 +19088,23 @@ public partial class HealthcareApis /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// - /// The name of the resource group that contains the service instance. /// The subscription identifier. + /// The name of the resource group that contains the service instance. /// The name of workspace resource. /// The parameters for updating a specified workspace. /// 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 WorkspacesUpdate_Validate(string resourceGroupName, string subscriptionId, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1 body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkspacesUpdate_Validate(string subscriptionId, string resourceGroupName, string workspaceName, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePatchResource body, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(workspaceName),workspaceName); await eventListener.AssertMinimumLength(nameof(workspaceName),workspaceName,3); await eventListener.AssertMaximumLength(nameof(workspaceName),workspaceName,24); diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Any.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Any.PowerShell.cs index 13af96d7f62f..e787754d6bd6 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Any.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Any.PowerShell.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial class Any { @@ -54,6 +54,14 @@ public partial class Any partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + /// /// Deserializes a into a new instance of . @@ -125,8 +133,20 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IAny Dese /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial interface IAny diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Any.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Any.cs index a3c5a3bd2c56..a1e11f48ae04 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Any.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Any.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; - /// Any object + /// Anything public partial class Any : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IAny, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IAnyInternal @@ -19,13 +19,13 @@ public Any() } } - /// Any object + /// Anything public partial interface IAny : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable { } - /// Any object + /// Anything internal partial interface IAnyInternal { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Any.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Any.json.cs index 8f7df90a5354..6df8935c94df 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Any.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Any.json.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; - /// Any object + /// Anything public partial class Any { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomService.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomService.PowerShell.cs deleted file mode 100644 index 75e76afe1033..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomService.PowerShell.cs +++ /dev/null @@ -1,344 +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.HealthcareApis.Models.Api20211101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; - - /// The description of Dicom Service - [System.ComponentModel.TypeConverter(typeof(DicomServiceTypeConverter))] - public partial class DicomService - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new DicomService(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.HealthcareApis.Models.Api20211101.IDicomService DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new DicomService(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal DicomService(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.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServicePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType.CreateFrom); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityUserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentitiesTypeConverter.ConvertFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGeneratedTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("AuthenticationConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceAuthenticationConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ServiceUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).ServiceUrl = (string) content.GetValueForProperty("ServiceUrl",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).ServiceUrl, global::System.Convert.ToString); - } - if (content.Contains("PrivateEndpointConnection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionTypeConverter.ConvertFrom)); - } - if (content.Contains("PublicNetworkAccess")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("AuthenticationConfigurationAuthority")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationAudience")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).AuthenticationConfigurationAudience = (string[]) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).AuthenticationConfigurationAudience, __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 DicomService(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.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServicePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType.CreateFrom); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityUserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentitiesTypeConverter.ConvertFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGeneratedTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("AuthenticationConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceAuthenticationConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ServiceUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).ServiceUrl = (string) content.GetValueForProperty("ServiceUrl",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).ServiceUrl, global::System.Convert.ToString); - } - if (content.Contains("PrivateEndpointConnection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionTypeConverter.ConvertFrom)); - } - if (content.Contains("PublicNetworkAccess")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("AuthenticationConfigurationAuthority")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationAudience")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).AuthenticationConfigurationAudience = (string[]) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal)this).AuthenticationConfigurationAudience, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - 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.HealthcareApis.Models.Api20211101.IDicomService FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The description of Dicom Service - [System.ComponentModel.TypeConverter(typeof(DicomServiceTypeConverter))] - public partial interface IDicomService - - { - - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirService.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirService.PowerShell.cs deleted file mode 100644 index b5806cf5fa2c..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirService.PowerShell.cs +++ /dev/null @@ -1,480 +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.HealthcareApis.Models.Api20211101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; - - /// The description of Fhir Service - [System.ComponentModel.TypeConverter(typeof(FhirServiceTypeConverter))] - public partial class FhirService - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new FhirService(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.HealthcareApis.Models.Api20211101.IFhirService DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new FhirService(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal FhirService(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.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServicePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind.CreateFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType.CreateFrom); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityUserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentitiesTypeConverter.ConvertFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGeneratedTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("AcrConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AcrConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration) content.GetValueForProperty("AcrConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AcrConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAcrConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AuthenticationConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAuthenticationConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("CorsConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorsConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration) content.GetValueForProperty("CorsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorsConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceCorsConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ExportConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ExportConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration) content.GetValueForProperty("ExportConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ExportConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceExportConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ResourceVersionPolicyConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ResourceVersionPolicyConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration) content.GetValueForProperty("ResourceVersionPolicyConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ResourceVersionPolicyConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AccessPolicy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AccessPolicy = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry[]) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AccessPolicy, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAccessPolicyEntryTypeConverter.ConvertFrom)); - } - if (content.Contains("PrivateEndpointConnection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionTypeConverter.ConvertFrom)); - } - if (content.Contains("PublicNetworkAccess")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); - } - if (content.Contains("EventState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).EventState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState?) content.GetValueForProperty("EventState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).EventState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState.CreateFrom); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("AcrConfigurationLoginServer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AcrConfigurationLoginServer = (string[]) content.GetValueForProperty("AcrConfigurationLoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AcrConfigurationLoginServer, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AcrConfigurationOciArtifact")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AcrConfigurationOciArtifact = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]) content.GetValueForProperty("AcrConfigurationOciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AcrConfigurationOciArtifact, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); - } - if (content.Contains("AuthenticationConfigurationAuthority")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationAudience")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AuthenticationConfigurationAudience = (string) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AuthenticationConfigurationAudience, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationSmartProxyEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AuthenticationConfigurationSmartProxyEnabled = (bool?) content.GetValueForProperty("AuthenticationConfigurationSmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AuthenticationConfigurationSmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("CorConfigurationOrigin")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationOrigin = (string[]) content.GetValueForProperty("CorConfigurationOrigin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationOrigin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationHeader")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationHeader = (string[]) content.GetValueForProperty("CorConfigurationHeader",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationHeader, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationMethod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationMethod = (string[]) content.GetValueForProperty("CorConfigurationMethod",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationMethod, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationMaxAge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationMaxAge = (int?) content.GetValueForProperty("CorConfigurationMaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationMaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("CorConfigurationAllowCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationAllowCredentials = (bool?) content.GetValueForProperty("CorConfigurationAllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationAllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ExportConfigurationStorageAccountName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ExportConfigurationStorageAccountName = (string) content.GetValueForProperty("ExportConfigurationStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ExportConfigurationStorageAccountName, global::System.Convert.ToString); - } - if (content.Contains("ResourceVersionPolicyConfigurationDefault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ResourceVersionPolicyConfigurationDefault = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy?) content.GetValueForProperty("ResourceVersionPolicyConfigurationDefault",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ResourceVersionPolicyConfigurationDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy.CreateFrom); - } - if (content.Contains("ResourceVersionPolicyConfigurationResourceTypeOverride")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ResourceVersionPolicyConfigurationResourceTypeOverride = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides) content.GetValueForProperty("ResourceVersionPolicyConfigurationResourceTypeOverride",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ResourceVersionPolicyConfigurationResourceTypeOverride, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfigurationResourceTypeOverridesTypeConverter.ConvertFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal FhirService(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.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServicePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind.CreateFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType.CreateFrom); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityUserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentitiesTypeConverter.ConvertFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGeneratedTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("AcrConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AcrConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration) content.GetValueForProperty("AcrConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AcrConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAcrConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AuthenticationConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAuthenticationConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("CorsConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorsConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration) content.GetValueForProperty("CorsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorsConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceCorsConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ExportConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ExportConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration) content.GetValueForProperty("ExportConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ExportConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceExportConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ResourceVersionPolicyConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ResourceVersionPolicyConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration) content.GetValueForProperty("ResourceVersionPolicyConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ResourceVersionPolicyConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AccessPolicy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AccessPolicy = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry[]) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AccessPolicy, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAccessPolicyEntryTypeConverter.ConvertFrom)); - } - if (content.Contains("PrivateEndpointConnection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionTypeConverter.ConvertFrom)); - } - if (content.Contains("PublicNetworkAccess")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); - } - if (content.Contains("EventState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).EventState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState?) content.GetValueForProperty("EventState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).EventState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState.CreateFrom); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("AcrConfigurationLoginServer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AcrConfigurationLoginServer = (string[]) content.GetValueForProperty("AcrConfigurationLoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AcrConfigurationLoginServer, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AcrConfigurationOciArtifact")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AcrConfigurationOciArtifact = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]) content.GetValueForProperty("AcrConfigurationOciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AcrConfigurationOciArtifact, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); - } - if (content.Contains("AuthenticationConfigurationAuthority")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationAudience")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AuthenticationConfigurationAudience = (string) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AuthenticationConfigurationAudience, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationSmartProxyEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AuthenticationConfigurationSmartProxyEnabled = (bool?) content.GetValueForProperty("AuthenticationConfigurationSmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).AuthenticationConfigurationSmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("CorConfigurationOrigin")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationOrigin = (string[]) content.GetValueForProperty("CorConfigurationOrigin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationOrigin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationHeader")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationHeader = (string[]) content.GetValueForProperty("CorConfigurationHeader",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationHeader, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationMethod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationMethod = (string[]) content.GetValueForProperty("CorConfigurationMethod",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationMethod, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationMaxAge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationMaxAge = (int?) content.GetValueForProperty("CorConfigurationMaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationMaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("CorConfigurationAllowCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationAllowCredentials = (bool?) content.GetValueForProperty("CorConfigurationAllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).CorConfigurationAllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ExportConfigurationStorageAccountName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ExportConfigurationStorageAccountName = (string) content.GetValueForProperty("ExportConfigurationStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ExportConfigurationStorageAccountName, global::System.Convert.ToString); - } - if (content.Contains("ResourceVersionPolicyConfigurationDefault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ResourceVersionPolicyConfigurationDefault = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy?) content.GetValueForProperty("ResourceVersionPolicyConfigurationDefault",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ResourceVersionPolicyConfigurationDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy.CreateFrom); - } - if (content.Contains("ResourceVersionPolicyConfigurationResourceTypeOverride")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ResourceVersionPolicyConfigurationResourceTypeOverride = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides) content.GetValueForProperty("ResourceVersionPolicyConfigurationResourceTypeOverride",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal)this).ResourceVersionPolicyConfigurationResourceTypeOverride, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfigurationResourceTypeOverridesTypeConverter.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.HealthcareApis.Models.Api20211101.IFhirService FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The description of Fhir Service - [System.ComponentModel.TypeConverter(typeof(FhirServiceTypeConverter))] - public partial interface IFhirService - - { - - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceProperties.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceProperties.PowerShell.cs deleted file mode 100644 index 1161fa8a87ae..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceProperties.PowerShell.cs +++ /dev/null @@ -1,322 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; - - /// Fhir Service properties. - [System.ComponentModel.TypeConverter(typeof(FhirServicePropertiesTypeConverter))] - public partial class FhirServiceProperties - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new FhirServiceProperties(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.HealthcareApis.Models.Api20211101.IFhirServiceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new FhirServiceProperties(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal FhirServiceProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AcrConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AcrConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration) content.GetValueForProperty("AcrConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AcrConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAcrConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AuthenticationConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAuthenticationConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("CorsConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorsConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration) content.GetValueForProperty("CorsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorsConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceCorsConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ExportConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ExportConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration) content.GetValueForProperty("ExportConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ExportConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceExportConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ResourceVersionPolicyConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration) content.GetValueForProperty("ResourceVersionPolicyConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("AccessPolicy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AccessPolicy = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry[]) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AccessPolicy, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAccessPolicyEntryTypeConverter.ConvertFrom)); - } - if (content.Contains("PrivateEndpointConnection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionTypeConverter.ConvertFrom)); - } - if (content.Contains("PublicNetworkAccess")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); - } - if (content.Contains("EventState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).EventState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState?) content.GetValueForProperty("EventState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).EventState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState.CreateFrom); - } - if (content.Contains("AcrConfigurationLoginServer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AcrConfigurationLoginServer = (string[]) content.GetValueForProperty("AcrConfigurationLoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AcrConfigurationLoginServer, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AcrConfigurationOciArtifact")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AcrConfigurationOciArtifact = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]) content.GetValueForProperty("AcrConfigurationOciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AcrConfigurationOciArtifact, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); - } - if (content.Contains("AuthenticationConfigurationAuthority")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationAudience")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AuthenticationConfigurationAudience = (string) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AuthenticationConfigurationAudience, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationSmartProxyEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AuthenticationConfigurationSmartProxyEnabled = (bool?) content.GetValueForProperty("AuthenticationConfigurationSmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AuthenticationConfigurationSmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("CorConfigurationOrigin")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationOrigin = (string[]) content.GetValueForProperty("CorConfigurationOrigin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationOrigin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationHeader")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationHeader = (string[]) content.GetValueForProperty("CorConfigurationHeader",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationHeader, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationMethod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationMethod = (string[]) content.GetValueForProperty("CorConfigurationMethod",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationMethod, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationMaxAge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationMaxAge = (int?) content.GetValueForProperty("CorConfigurationMaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationMaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("CorConfigurationAllowCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationAllowCredentials = (bool?) content.GetValueForProperty("CorConfigurationAllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationAllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ExportConfigurationStorageAccountName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ExportConfigurationStorageAccountName = (string) content.GetValueForProperty("ExportConfigurationStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ExportConfigurationStorageAccountName, global::System.Convert.ToString); - } - if (content.Contains("ResourceVersionPolicyConfigurationDefault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfigurationDefault = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy?) content.GetValueForProperty("ResourceVersionPolicyConfigurationDefault",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfigurationDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy.CreateFrom); - } - if (content.Contains("ResourceVersionPolicyConfigurationResourceTypeOverride")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfigurationResourceTypeOverride = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides) content.GetValueForProperty("ResourceVersionPolicyConfigurationResourceTypeOverride",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfigurationResourceTypeOverride, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfigurationResourceTypeOverridesTypeConverter.ConvertFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal FhirServiceProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AcrConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AcrConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration) content.GetValueForProperty("AcrConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AcrConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAcrConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AuthenticationConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAuthenticationConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("CorsConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorsConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration) content.GetValueForProperty("CorsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorsConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceCorsConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ExportConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ExportConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration) content.GetValueForProperty("ExportConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ExportConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceExportConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ResourceVersionPolicyConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration) content.GetValueForProperty("ResourceVersionPolicyConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("AccessPolicy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AccessPolicy = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry[]) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AccessPolicy, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAccessPolicyEntryTypeConverter.ConvertFrom)); - } - if (content.Contains("PrivateEndpointConnection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionTypeConverter.ConvertFrom)); - } - if (content.Contains("PublicNetworkAccess")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); - } - if (content.Contains("EventState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).EventState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState?) content.GetValueForProperty("EventState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).EventState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState.CreateFrom); - } - if (content.Contains("AcrConfigurationLoginServer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AcrConfigurationLoginServer = (string[]) content.GetValueForProperty("AcrConfigurationLoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AcrConfigurationLoginServer, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AcrConfigurationOciArtifact")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AcrConfigurationOciArtifact = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]) content.GetValueForProperty("AcrConfigurationOciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AcrConfigurationOciArtifact, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); - } - if (content.Contains("AuthenticationConfigurationAuthority")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationAudience")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AuthenticationConfigurationAudience = (string) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AuthenticationConfigurationAudience, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationSmartProxyEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AuthenticationConfigurationSmartProxyEnabled = (bool?) content.GetValueForProperty("AuthenticationConfigurationSmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).AuthenticationConfigurationSmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("CorConfigurationOrigin")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationOrigin = (string[]) content.GetValueForProperty("CorConfigurationOrigin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationOrigin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationHeader")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationHeader = (string[]) content.GetValueForProperty("CorConfigurationHeader",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationHeader, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationMethod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationMethod = (string[]) content.GetValueForProperty("CorConfigurationMethod",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationMethod, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationMaxAge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationMaxAge = (int?) content.GetValueForProperty("CorConfigurationMaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationMaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("CorConfigurationAllowCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationAllowCredentials = (bool?) content.GetValueForProperty("CorConfigurationAllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).CorConfigurationAllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ExportConfigurationStorageAccountName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ExportConfigurationStorageAccountName = (string) content.GetValueForProperty("ExportConfigurationStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ExportConfigurationStorageAccountName, global::System.Convert.ToString); - } - if (content.Contains("ResourceVersionPolicyConfigurationDefault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfigurationDefault = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy?) content.GetValueForProperty("ResourceVersionPolicyConfigurationDefault",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfigurationDefault, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy.CreateFrom); - } - if (content.Contains("ResourceVersionPolicyConfigurationResourceTypeOverride")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfigurationResourceTypeOverride = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides) content.GetValueForProperty("ResourceVersionPolicyConfigurationResourceTypeOverride",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfigurationResourceTypeOverride, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfigurationResourceTypeOverridesTypeConverter.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.HealthcareApis.Models.Api20211101.IFhirServiceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Fhir Service properties. - [System.ComponentModel.TypeConverter(typeof(FhirServicePropertiesTypeConverter))] - public partial interface IFhirServiceProperties - - { - - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnector.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnector.PowerShell.cs deleted file mode 100644 index 99d9d8b0dd8b..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnector.PowerShell.cs +++ /dev/null @@ -1,344 +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.HealthcareApis.Models.Api20211101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; - - /// IoT Connector definition. - [System.ComponentModel.TypeConverter(typeof(IotConnectorTypeConverter))] - public partial class IotConnector - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new IotConnector(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.HealthcareApis.Models.Api20211101.IIotConnector DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new IotConnector(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.HealthcareApis.Models.Api20211101.IIotConnector FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal IotConnector(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.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnectorPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType.CreateFrom); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityUserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentitiesTypeConverter.ConvertFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGeneratedTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("IngestionEndpointConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).IngestionEndpointConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration) content.GetValueForProperty("IngestionEndpointConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).IngestionEndpointConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotEventHubIngestionEndpointConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DeviceMapping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).DeviceMapping = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties) content.GetValueForProperty("DeviceMapping",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).DeviceMapping, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("IngestionEndpointConfigurationEventHubName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).IngestionEndpointConfigurationEventHubName = (string) content.GetValueForProperty("IngestionEndpointConfigurationEventHubName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).IngestionEndpointConfigurationEventHubName, global::System.Convert.ToString); - } - if (content.Contains("IngestionEndpointConfigurationConsumerGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).IngestionEndpointConfigurationConsumerGroup = (string) content.GetValueForProperty("IngestionEndpointConfigurationConsumerGroup",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).IngestionEndpointConfigurationConsumerGroup, global::System.Convert.ToString); - } - if (content.Contains("IngestionEndpointConfigurationFullyQualifiedEventHubNamespace")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace = (string) content.GetValueForProperty("IngestionEndpointConfigurationFullyQualifiedEventHubNamespace",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace, global::System.Convert.ToString); - } - if (content.Contains("DeviceMappingContent")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).DeviceMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent) content.GetValueForProperty("DeviceMappingContent",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).DeviceMappingContent, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesContentTypeConverter.ConvertFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal IotConnector(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.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnectorPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType.CreateFrom); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityUserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentitiesTypeConverter.ConvertFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGeneratedTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("IngestionEndpointConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).IngestionEndpointConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration) content.GetValueForProperty("IngestionEndpointConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).IngestionEndpointConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotEventHubIngestionEndpointConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("DeviceMapping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).DeviceMapping = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties) content.GetValueForProperty("DeviceMapping",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).DeviceMapping, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("IngestionEndpointConfigurationEventHubName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).IngestionEndpointConfigurationEventHubName = (string) content.GetValueForProperty("IngestionEndpointConfigurationEventHubName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).IngestionEndpointConfigurationEventHubName, global::System.Convert.ToString); - } - if (content.Contains("IngestionEndpointConfigurationConsumerGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).IngestionEndpointConfigurationConsumerGroup = (string) content.GetValueForProperty("IngestionEndpointConfigurationConsumerGroup",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).IngestionEndpointConfigurationConsumerGroup, global::System.Convert.ToString); - } - if (content.Contains("IngestionEndpointConfigurationFullyQualifiedEventHubNamespace")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace = (string) content.GetValueForProperty("IngestionEndpointConfigurationFullyQualifiedEventHubNamespace",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace, global::System.Convert.ToString); - } - if (content.Contains("DeviceMappingContent")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).DeviceMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent) content.GetValueForProperty("DeviceMappingContent",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal)this).DeviceMappingContent, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesContentTypeConverter.ConvertFrom); - } - 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.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// IoT Connector definition. - [System.ComponentModel.TypeConverter(typeof(IotConnectorTypeConverter))] - public partial interface IIotConnector - - { - - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestination.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestination.PowerShell.cs deleted file mode 100644 index c6ccae66b932..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestination.PowerShell.cs +++ /dev/null @@ -1,280 +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.HealthcareApis.Models.Api20211101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; - - /// IoT Connector FHIR destination definition. - [System.ComponentModel.TypeConverter(typeof(IotFhirDestinationTypeConverter))] - public partial class IotFhirDestination - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new IotFhirDestination(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.HealthcareApis.Models.Api20211101.IIotFhirDestination DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new IotFhirDestination(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.HealthcareApis.Models.Api20211101.IIotFhirDestination FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal IotFhirDestination(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.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotFhirDestinationPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("FhirMapping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).FhirMapping = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties) content.GetValueForProperty("FhirMapping",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).FhirMapping, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("ResourceIdentityResolutionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).ResourceIdentityResolutionType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType) content.GetValueForProperty("ResourceIdentityResolutionType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).ResourceIdentityResolutionType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType.CreateFrom); - } - if (content.Contains("FhirServiceResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).FhirServiceResourceId = (string) content.GetValueForProperty("FhirServiceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).FhirServiceResourceId, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("FhirMappingContent")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).FhirMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent) content.GetValueForProperty("FhirMappingContent",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).FhirMappingContent, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesContentTypeConverter.ConvertFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal IotFhirDestination(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.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotFhirDestinationPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("FhirMapping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).FhirMapping = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties) content.GetValueForProperty("FhirMapping",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).FhirMapping, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("ResourceIdentityResolutionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).ResourceIdentityResolutionType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType) content.GetValueForProperty("ResourceIdentityResolutionType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).ResourceIdentityResolutionType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType.CreateFrom); - } - if (content.Contains("FhirServiceResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).FhirServiceResourceId = (string) content.GetValueForProperty("FhirServiceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).FhirServiceResourceId, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("FhirMappingContent")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).FhirMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent) content.GetValueForProperty("FhirMappingContent",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal)this).FhirMappingContent, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesContentTypeConverter.ConvertFrom); - } - 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.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// IoT Connector FHIR destination definition. - [System.ComponentModel.TypeConverter(typeof(IotFhirDestinationTypeConverter))] - public partial interface IIotFhirDestination - - { - - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionDescription.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionDescription.PowerShell.cs deleted file mode 100644 index a54b7dea0581..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionDescription.PowerShell.cs +++ /dev/null @@ -1,284 +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.HealthcareApis.Models.Api20211101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; - - /// The Private Endpoint Connection resource. - [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionDescriptionTypeConverter))] - public partial class PrivateEndpointConnectionDescription - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new PrivateEndpointConnectionDescription(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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new PrivateEndpointConnectionDescription(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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal PrivateEndpointConnectionDescription(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("PrivateEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointTypeConverter.ConvertFrom); - } - if (content.Contains("PrivateLinkServiceConnectionState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); - } - if (content.Contains("PrivateEndpointId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); - } - if (content.Contains("PrivateLinkServiceConnectionStateDescription")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); - } - if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); - } - if (content.Contains("PrivateLinkServiceConnectionStateStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal PrivateEndpointConnectionDescription(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("PrivateEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointTypeConverter.ConvertFrom); - } - if (content.Contains("PrivateLinkServiceConnectionState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); - } - if (content.Contains("PrivateEndpointId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); - } - if (content.Contains("PrivateLinkServiceConnectionStateDescription")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); - } - if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); - } - if (content.Contains("PrivateLinkServiceConnectionStateStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - 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.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The Private Endpoint Connection resource. - [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionDescriptionTypeConverter))] - public partial interface IPrivateEndpointConnectionDescription - - { - - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescription.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescription.PowerShell.cs deleted file mode 100644 index 1f6b8de051b5..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescription.PowerShell.cs +++ /dev/null @@ -1,464 +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.HealthcareApis.Models.Api20211101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; - - /// The description of the service. - [System.ComponentModel.TypeConverter(typeof(ServicesDescriptionTypeConverter))] - public partial class ServicesDescription - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ServicesDescription(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.HealthcareApis.Models.Api20211101.IServicesDescription DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ServicesDescription(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.HealthcareApis.Models.Api20211101.IServicesDescription FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ServicesDescription(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.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType.CreateFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResourceIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind.CreateFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CosmosDbConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CosmosDbConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo) content.GetValueForProperty("CosmosDbConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CosmosDbConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceCosmosDbConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("AuthenticationConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAuthenticationConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("CorsConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorsConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo) content.GetValueForProperty("CorsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorsConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceCorsConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ExportConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).ExportConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo) content.GetValueForProperty("ExportConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).ExportConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceExportConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("AcrConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AcrConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo) content.GetValueForProperty("AcrConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AcrConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAcrConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("AccessPolicy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AccessPolicy = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry[]) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AccessPolicy, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAccessPolicyEntryTypeConverter.ConvertFrom)); - } - if (content.Contains("PrivateEndpointConnection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionTypeConverter.ConvertFrom)); - } - if (content.Contains("PublicNetworkAccess")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CosmoDbConfigurationOfferThroughput")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CosmoDbConfigurationOfferThroughput = (int?) content.GetValueForProperty("CosmoDbConfigurationOfferThroughput",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CosmoDbConfigurationOfferThroughput, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("CosmoDbConfigurationKeyVaultKeyUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CosmoDbConfigurationKeyVaultKeyUri = (string) content.GetValueForProperty("CosmoDbConfigurationKeyVaultKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CosmoDbConfigurationKeyVaultKeyUri, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationAuthority")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationAudience")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AuthenticationConfigurationAudience = (string) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AuthenticationConfigurationAudience, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationSmartProxyEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AuthenticationConfigurationSmartProxyEnabled = (bool?) content.GetValueForProperty("AuthenticationConfigurationSmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AuthenticationConfigurationSmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("CorConfigurationOrigin")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationOrigin = (string[]) content.GetValueForProperty("CorConfigurationOrigin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationOrigin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationHeader")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationHeader = (string[]) content.GetValueForProperty("CorConfigurationHeader",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationHeader, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationMethod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationMethod = (string[]) content.GetValueForProperty("CorConfigurationMethod",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationMethod, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationMaxAge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationMaxAge = (int?) content.GetValueForProperty("CorConfigurationMaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationMaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("CorConfigurationAllowCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationAllowCredentials = (bool?) content.GetValueForProperty("CorConfigurationAllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationAllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ExportConfigurationStorageAccountName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).ExportConfigurationStorageAccountName = (string) content.GetValueForProperty("ExportConfigurationStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).ExportConfigurationStorageAccountName, global::System.Convert.ToString); - } - if (content.Contains("AcrConfigurationLoginServer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AcrConfigurationLoginServer = (string[]) content.GetValueForProperty("AcrConfigurationLoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AcrConfigurationLoginServer, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AcrConfigurationOciArtifact")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AcrConfigurationOciArtifact = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]) content.GetValueForProperty("AcrConfigurationOciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AcrConfigurationOciArtifact, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ServicesDescription(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.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType.CreateFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResourceIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind.CreateFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CosmosDbConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CosmosDbConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo) content.GetValueForProperty("CosmosDbConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CosmosDbConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceCosmosDbConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("AuthenticationConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAuthenticationConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("CorsConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorsConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo) content.GetValueForProperty("CorsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorsConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceCorsConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ExportConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).ExportConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo) content.GetValueForProperty("ExportConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).ExportConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceExportConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("AcrConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AcrConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo) content.GetValueForProperty("AcrConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AcrConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAcrConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("AccessPolicy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AccessPolicy = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry[]) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AccessPolicy, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAccessPolicyEntryTypeConverter.ConvertFrom)); - } - if (content.Contains("PrivateEndpointConnection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionTypeConverter.ConvertFrom)); - } - if (content.Contains("PublicNetworkAccess")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CosmoDbConfigurationOfferThroughput")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CosmoDbConfigurationOfferThroughput = (int?) content.GetValueForProperty("CosmoDbConfigurationOfferThroughput",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CosmoDbConfigurationOfferThroughput, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("CosmoDbConfigurationKeyVaultKeyUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CosmoDbConfigurationKeyVaultKeyUri = (string) content.GetValueForProperty("CosmoDbConfigurationKeyVaultKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CosmoDbConfigurationKeyVaultKeyUri, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationAuthority")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationAudience")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AuthenticationConfigurationAudience = (string) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AuthenticationConfigurationAudience, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationSmartProxyEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AuthenticationConfigurationSmartProxyEnabled = (bool?) content.GetValueForProperty("AuthenticationConfigurationSmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AuthenticationConfigurationSmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("CorConfigurationOrigin")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationOrigin = (string[]) content.GetValueForProperty("CorConfigurationOrigin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationOrigin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationHeader")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationHeader = (string[]) content.GetValueForProperty("CorConfigurationHeader",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationHeader, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationMethod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationMethod = (string[]) content.GetValueForProperty("CorConfigurationMethod",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationMethod, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationMaxAge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationMaxAge = (int?) content.GetValueForProperty("CorConfigurationMaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationMaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("CorConfigurationAllowCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationAllowCredentials = (bool?) content.GetValueForProperty("CorConfigurationAllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).CorConfigurationAllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ExportConfigurationStorageAccountName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).ExportConfigurationStorageAccountName = (string) content.GetValueForProperty("ExportConfigurationStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).ExportConfigurationStorageAccountName, global::System.Convert.ToString); - } - if (content.Contains("AcrConfigurationLoginServer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AcrConfigurationLoginServer = (string[]) content.GetValueForProperty("AcrConfigurationLoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AcrConfigurationLoginServer, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AcrConfigurationOciArtifact")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AcrConfigurationOciArtifact = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]) content.GetValueForProperty("AcrConfigurationOciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal)this).AcrConfigurationOciArtifact, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); - } - 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.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The description of the service. - [System.ComponentModel.TypeConverter(typeof(ServicesDescriptionTypeConverter))] - public partial interface IServicesDescription - - { - - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesProperties.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesProperties.PowerShell.cs deleted file mode 100644 index 4a9b00438569..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesProperties.PowerShell.cs +++ /dev/null @@ -1,312 +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.HealthcareApis.Models.Api20211101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; - - /// The properties of a service instance. - [System.ComponentModel.TypeConverter(typeof(ServicesPropertiesTypeConverter))] - public partial class ServicesProperties - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ServicesProperties(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.HealthcareApis.Models.Api20211101.IServicesProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ServicesProperties(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.HealthcareApis.Models.Api20211101.IServicesProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ServicesProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("CosmosDbConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CosmosDbConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo) content.GetValueForProperty("CosmosDbConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CosmosDbConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceCosmosDbConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("AuthenticationConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAuthenticationConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("CorsConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorsConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo) content.GetValueForProperty("CorsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorsConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceCorsConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ExportConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).ExportConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo) content.GetValueForProperty("ExportConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).ExportConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceExportConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("AcrConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AcrConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo) content.GetValueForProperty("AcrConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AcrConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAcrConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("AccessPolicy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AccessPolicy = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry[]) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AccessPolicy, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAccessPolicyEntryTypeConverter.ConvertFrom)); - } - if (content.Contains("PrivateEndpointConnection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionTypeConverter.ConvertFrom)); - } - if (content.Contains("PublicNetworkAccess")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); - } - if (content.Contains("CosmoDbConfigurationOfferThroughput")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CosmoDbConfigurationOfferThroughput = (int?) content.GetValueForProperty("CosmoDbConfigurationOfferThroughput",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CosmoDbConfigurationOfferThroughput, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("CosmoDbConfigurationKeyVaultKeyUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CosmoDbConfigurationKeyVaultKeyUri = (string) content.GetValueForProperty("CosmoDbConfigurationKeyVaultKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CosmoDbConfigurationKeyVaultKeyUri, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationAuthority")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationAudience")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AuthenticationConfigurationAudience = (string) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AuthenticationConfigurationAudience, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationSmartProxyEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AuthenticationConfigurationSmartProxyEnabled = (bool?) content.GetValueForProperty("AuthenticationConfigurationSmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AuthenticationConfigurationSmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("CorConfigurationOrigin")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationOrigin = (string[]) content.GetValueForProperty("CorConfigurationOrigin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationOrigin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationHeader")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationHeader = (string[]) content.GetValueForProperty("CorConfigurationHeader",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationHeader, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationMethod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationMethod = (string[]) content.GetValueForProperty("CorConfigurationMethod",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationMethod, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationMaxAge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationMaxAge = (int?) content.GetValueForProperty("CorConfigurationMaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationMaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("CorConfigurationAllowCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationAllowCredentials = (bool?) content.GetValueForProperty("CorConfigurationAllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationAllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ExportConfigurationStorageAccountName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).ExportConfigurationStorageAccountName = (string) content.GetValueForProperty("ExportConfigurationStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).ExportConfigurationStorageAccountName, global::System.Convert.ToString); - } - if (content.Contains("AcrConfigurationLoginServer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AcrConfigurationLoginServer = (string[]) content.GetValueForProperty("AcrConfigurationLoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AcrConfigurationLoginServer, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AcrConfigurationOciArtifact")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AcrConfigurationOciArtifact = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]) content.GetValueForProperty("AcrConfigurationOciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AcrConfigurationOciArtifact, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ServicesProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("CosmosDbConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CosmosDbConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo) content.GetValueForProperty("CosmosDbConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CosmosDbConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceCosmosDbConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("AuthenticationConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAuthenticationConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("CorsConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorsConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo) content.GetValueForProperty("CorsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorsConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceCorsConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ExportConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).ExportConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo) content.GetValueForProperty("ExportConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).ExportConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceExportConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("AcrConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AcrConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo) content.GetValueForProperty("AcrConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AcrConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAcrConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("AccessPolicy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AccessPolicy = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry[]) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AccessPolicy, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAccessPolicyEntryTypeConverter.ConvertFrom)); - } - if (content.Contains("PrivateEndpointConnection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionTypeConverter.ConvertFrom)); - } - if (content.Contains("PublicNetworkAccess")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); - } - if (content.Contains("CosmoDbConfigurationOfferThroughput")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CosmoDbConfigurationOfferThroughput = (int?) content.GetValueForProperty("CosmoDbConfigurationOfferThroughput",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CosmoDbConfigurationOfferThroughput, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("CosmoDbConfigurationKeyVaultKeyUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CosmoDbConfigurationKeyVaultKeyUri = (string) content.GetValueForProperty("CosmoDbConfigurationKeyVaultKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CosmoDbConfigurationKeyVaultKeyUri, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationAuthority")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationAudience")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AuthenticationConfigurationAudience = (string) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AuthenticationConfigurationAudience, global::System.Convert.ToString); - } - if (content.Contains("AuthenticationConfigurationSmartProxyEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AuthenticationConfigurationSmartProxyEnabled = (bool?) content.GetValueForProperty("AuthenticationConfigurationSmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AuthenticationConfigurationSmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("CorConfigurationOrigin")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationOrigin = (string[]) content.GetValueForProperty("CorConfigurationOrigin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationOrigin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationHeader")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationHeader = (string[]) content.GetValueForProperty("CorConfigurationHeader",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationHeader, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationMethod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationMethod = (string[]) content.GetValueForProperty("CorConfigurationMethod",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationMethod, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CorConfigurationMaxAge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationMaxAge = (int?) content.GetValueForProperty("CorConfigurationMaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationMaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("CorConfigurationAllowCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationAllowCredentials = (bool?) content.GetValueForProperty("CorConfigurationAllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).CorConfigurationAllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ExportConfigurationStorageAccountName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).ExportConfigurationStorageAccountName = (string) content.GetValueForProperty("ExportConfigurationStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).ExportConfigurationStorageAccountName, global::System.Convert.ToString); - } - if (content.Contains("AcrConfigurationLoginServer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AcrConfigurationLoginServer = (string[]) content.GetValueForProperty("AcrConfigurationLoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AcrConfigurationLoginServer, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AcrConfigurationOciArtifact")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AcrConfigurationOciArtifact = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]) content.GetValueForProperty("AcrConfigurationOciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)this).AcrConfigurationOciArtifact, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); - } - 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.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The properties of a service instance. - [System.ComponentModel.TypeConverter(typeof(ServicesPropertiesTypeConverter))] - public partial interface IServicesProperties - - { - - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Workspace.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Workspace.PowerShell.cs deleted file mode 100644 index fa016d16c2c3..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Workspace.PowerShell.cs +++ /dev/null @@ -1,272 +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.HealthcareApis.Models.Api20211101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; - - /// Workspace resource. - [System.ComponentModel.TypeConverter(typeof(WorkspaceTypeConverter))] - public partial class Workspace - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Workspace(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.HealthcareApis.Models.Api20211101.IWorkspace DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Workspace(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.HealthcareApis.Models.Api20211101.IWorkspace FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal Workspace(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.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.WorkspacePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PrivateEndpointConnection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionTypeConverter.ConvertFrom)); - } - if (content.Contains("PublicNetworkAccess")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal Workspace(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.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.WorkspacePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PrivateEndpointConnection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionTypeConverter.ConvertFrom)); - } - if (content.Contains("PublicNetworkAccess")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - AfterDeserializePSObject(content); - } - } - /// Workspace resource. - [System.ComponentModel.TypeConverter(typeof(WorkspaceTypeConverter))] - public partial interface IWorkspace - - { - - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/CheckNameAvailabilityParameters.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/CheckNameAvailabilityParameters.PowerShell.cs similarity index 73% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/CheckNameAvailabilityParameters.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/CheckNameAvailabilityParameters.PowerShell.cs index 1944dfdbfa47..dab78f2331e4 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/CheckNameAvailabilityParameters.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/CheckNameAvailabilityParameters.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class CheckNameAvailabilityParameters partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -70,17 +78,17 @@ internal CheckNameAvailabilityParameters(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParametersInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParametersInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParametersInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParametersInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParametersInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParametersInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParametersInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParametersInternal)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. @@ -95,39 +103,37 @@ internal CheckNameAvailabilityParameters(global::System.Management.Automation.PS // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParametersInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParametersInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParametersInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParametersInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParametersInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParametersInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParametersInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParametersInternal)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.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CheckNameAvailabilityParameters(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.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CheckNameAvailabilityParameters(content); } @@ -137,12 +143,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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(); + } } /// Input values. [System.ComponentModel.TypeConverter(typeof(CheckNameAvailabilityParametersTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/CheckNameAvailabilityParameters.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/CheckNameAvailabilityParameters.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/CheckNameAvailabilityParameters.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/CheckNameAvailabilityParameters.TypeConverter.cs index 7cf8d290d903..302b1eb940cf 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/CheckNameAvailabilityParameters.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/CheckNameAvailabilityParameters.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/CheckNameAvailabilityParameters.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/CheckNameAvailabilityParameters.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/CheckNameAvailabilityParameters.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/CheckNameAvailabilityParameters.cs index ba9f8f4f2ad6..0ed4376e8d42 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/CheckNameAvailabilityParameters.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/CheckNameAvailabilityParameters.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Input values. public partial class CheckNameAvailabilityParameters : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParametersInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParametersInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface ICheckNameAvailabilityParameters : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the service instance to check.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface ICheckNameAvailabilityParameters : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The fully qualified resource type which includes provider namespace.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/CheckNameAvailabilityParameters.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/CheckNameAvailabilityParameters.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/CheckNameAvailabilityParameters.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/CheckNameAvailabilityParameters.json.cs index 82e558bfa383..85e5bbbc66e8 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/CheckNameAvailabilityParameters.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/CheckNameAvailabilityParameters.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -65,19 +65,19 @@ internal CheckNameAvailabilityParameters(Microsoft.Azure.PowerShell.Cmdlets.Heal { 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); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new CheckNameAvailabilityParameters(json) : null; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomService.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomService.PowerShell.cs new file mode 100644 index 000000000000..39baecee6a3a --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomService.PowerShell.cs @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + + /// The description of Dicom Service + [System.ComponentModel.TypeConverter(typeof(DicomServiceTypeConverter))] + public partial class DicomService + { + + /// + /// 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.HealthcareApis.Models.IDicomService DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DicomService(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.HealthcareApis.Models.IDicomService DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DicomService(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DicomService(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.HealthcareApis.Models.IDicomServiceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServicePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1TypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AuthenticationConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceAuthenticationConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).ServiceUrl = (string) content.GetValueForProperty("ServiceUrl",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).ServiceUrl, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).PublicNetworkAccess, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AuthenticationConfigurationAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationAudience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).AuthenticationConfigurationAudience = (System.Collections.Generic.List) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).AuthenticationConfigurationAudience, __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 DicomService(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.HealthcareApis.Models.IDicomServiceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServicePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1TypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AuthenticationConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceAuthenticationConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).ServiceUrl = (string) content.GetValueForProperty("ServiceUrl",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).ServiceUrl, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).PublicNetworkAccess, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AuthenticationConfigurationAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationAudience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).AuthenticationConfigurationAudience = (System.Collections.Generic.List) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal)this).AuthenticationConfigurationAudience, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + 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.HealthcareApis.Models.IDicomService FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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 description of Dicom Service + [System.ComponentModel.TypeConverter(typeof(DicomServiceTypeConverter))] + public partial interface IDicomService + + { + + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomService.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomService.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomService.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomService.TypeConverter.cs index f7fc8038d44e..fdb5c532809d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomService.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomService.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IDicomService ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomService.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomService.cs similarity index 55% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomService.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomService.cs index baf7ef686c3e..495689cb1467 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomService.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomService.cs @@ -3,77 +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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The description of Dicom Service public partial class DicomService : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentity(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity(); /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResource __taggedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.TaggedResource(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResource __taggedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.TaggedResource(); /// The audiences for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string[] AuthenticationConfigurationAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).AuthenticationConfigurationAudience; } + public System.Collections.Generic.List AuthenticationConfigurationAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).AuthenticationConfigurationAudience; } /// The authority url for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string AuthenticationConfigurationAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).AuthenticationConfigurationAuthority; } + public string AuthenticationConfigurationAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).AuthenticationConfigurationAuthority; } /// /// An etag associated with the resource, used for optimistic concurrency when editing it. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Etag = value ?? null; } /// The resource identifier. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Id; } /// /// Setting indicating whether the service has a managed identity associated with it. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity = value ?? null /* model class */; } /// /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; } + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; } /// /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; } + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; } /// /// Type of identity being specified, currently SystemAssigned and None are allowed. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType)""); } + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType = value ?? null; } /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM @@ -82,81 +82,102 @@ public partial class DicomService : /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity = value ?? null /* model class */; } /// The resource location. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.FormatTable(Index = 0)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)__taggedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)__taggedResource).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)__taggedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)__taggedResource).Location = value ?? null; } /// Internal Acessors for AuthenticationConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal.AuthenticationConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).AuthenticationConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).AuthenticationConfiguration = value; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal.AuthenticationConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).AuthenticationConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).AuthenticationConfiguration = value ?? null /* model class */; } /// Internal Acessors for AuthenticationConfigurationAudience - string[] Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal.AuthenticationConfigurationAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).AuthenticationConfigurationAudience; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).AuthenticationConfigurationAudience = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal.AuthenticationConfigurationAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).AuthenticationConfigurationAudience; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).AuthenticationConfigurationAudience = value ?? null /* arrayOf */; } /// Internal Acessors for AuthenticationConfigurationAuthority - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal.AuthenticationConfigurationAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).AuthenticationConfigurationAuthority; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).AuthenticationConfigurationAuthority = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal.AuthenticationConfigurationAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).AuthenticationConfigurationAuthority; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).AuthenticationConfigurationAuthority = value ?? null; } /// Internal Acessors for PrivateEndpointConnection - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal.PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).PrivateEndpointConnection = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal.PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).PrivateEndpointConnection = value ?? null /* arrayOf */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).ProvisioningState = value ?? null; } /// Internal Acessors for ServiceUrl - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal.ServiceUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).ServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).ServiceUrl = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal.ServiceUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).ServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).ServiceUrl = value ?? null; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Type = value ?? null; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity = value ?? null /* model class */; } /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId = value ?? null; } /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId = value ?? null; } /// The resource name. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.FormatTable(Index = 1)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Name; } /// The list of private endpoint connections that are set up for this resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).PrivateEndpointConnection; } + public System.Collections.Generic.List PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).PrivateEndpointConnection; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceProperties _property; /// Dicom Service configuration. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceProperties()); set => this._property = value; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).ProvisioningState; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess)""); } + public string PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).PublicNetworkAccess = value ?? null; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] @@ -166,55 +187,55 @@ public partial class DicomService : /// The url of the Dicom Services. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string ServiceUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)Property).ServiceUrl; } + public string ServiceUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)Property).ServiceUrl; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData _systemData; /// Metadata pertaining to creation and last modification of the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)__taggedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)__taggedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)__taggedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)__taggedResource).Tag = value ?? null /* model class */; } /// The resource type. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Type; } /// Creates an new instance. public DicomService() @@ -239,21 +260,27 @@ public DicomService() /// The description of Dicom Service public partial interface IDicomService : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResource, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResource, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity { /// The audiences for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The audiences for the service", SerializedName = @"audiences", PossibleTypes = new [] { typeof(string) })] - string[] AuthenticationConfigurationAudience { get; } + System.Collections.Generic.List AuthenticationConfigurationAudience { get; } /// The authority url for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The authority url for the service", SerializedName = @"authority", PossibleTypes = new [] { typeof(string) })] @@ -262,32 +289,46 @@ public partial interface IDicomService : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The list of private endpoint connections that are set up for this resource.", SerializedName = @"privateEndpointConnections", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection) })] + System.Collections.Generic.List PrivateEndpointConnection { get; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } /// The url of the Dicom Services. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The url of the Dicom Services.", SerializedName = @"serviceUrl", PossibleTypes = new [] { typeof(string) })] @@ -295,90 +336,114 @@ public partial interface IDicomService : /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } + global::System.DateTime? SystemDataCreatedAt { get; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } + string SystemDataCreatedBy { get; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } + global::System.DateTime? SystemDataLastModifiedAt { get; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } + string SystemDataLastModifiedBy { get; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } } /// The description of Dicom Service internal partial interface IDicomServiceInternal : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResourceInternal, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal { /// Dicom Service authentication configuration. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration AuthenticationConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration AuthenticationConfiguration { get; set; } /// The audiences for the service - string[] AuthenticationConfigurationAudience { get; set; } + System.Collections.Generic.List AuthenticationConfigurationAudience { get; set; } /// The authority url for the service string AuthenticationConfigurationAuthority { get; set; } /// The list of private endpoint connections that are set up for this resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + System.Collections.Generic.List PrivateEndpointConnection { get; set; } /// Dicom Service configuration. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceProperties Property { get; set; } /// The provisioning state. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; set; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } /// The url of the Dicom Services. string ServiceUrl { get; set; } /// Metadata pertaining to creation and last modification of the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData SystemData { get; set; } /// The timestamp of resource creation (UTC). global::System.DateTime? SystemDataCreatedAt { get; set; } /// The identity that created the resource. string SystemDataCreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// The identity that last modified the resource. string SystemDataLastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomService.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomService.json.cs similarity index 92% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomService.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomService.json.cs index 99404f90d4af..e6f486ebaab6 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomService.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomService.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -65,21 +65,21 @@ internal DicomService(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime. { return; } - __taggedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.TaggedResource(json); - __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentity(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceProperties.FromJson(__jsonProperties) : Property;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData.FromJson(__jsonSystemData) : SystemData;} + __taggedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.TaggedResource(json); + __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceProperties.FromJson(__jsonProperties) : _property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new DicomService(json) : null; } @@ -106,7 +106,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T __taggedResource?.ToJson(container, serializationMode); __serviceManagedIdentity?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceAuthenticationConfiguration.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceAuthenticationConfiguration.PowerShell.cs similarity index 71% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceAuthenticationConfiguration.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceAuthenticationConfiguration.PowerShell.cs index a5e0ba5cfbe5..cd8d02ccd919 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceAuthenticationConfiguration.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceAuthenticationConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,35 +55,43 @@ public partial class DicomServiceAuthenticationConfiguration partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DicomServiceAuthenticationConfiguration(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 . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DicomServiceAuthenticationConfiguration(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,17 +106,17 @@ internal DicomServiceAuthenticationConfiguration(global::System.Collections.IDic // actually deserialize if (content.Contains("Authority")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfigurationInternal)this).Authority = (string) content.GetValueForProperty("Authority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfigurationInternal)this).Authority, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfigurationInternal)this).Authority = (string) content.GetValueForProperty("Authority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfigurationInternal)this).Authority, global::System.Convert.ToString); } if (content.Contains("Audience")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfigurationInternal)this).Audience = (string[]) content.GetValueForProperty("Audience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfigurationInternal)this).Audience, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfigurationInternal)this).Audience = (System.Collections.Generic.List) content.GetValueForProperty("Audience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfigurationInternal)this).Audience, __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. @@ -123,11 +131,11 @@ internal DicomServiceAuthenticationConfiguration(global::System.Management.Autom // actually deserialize if (content.Contains("Authority")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfigurationInternal)this).Authority = (string) content.GetValueForProperty("Authority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfigurationInternal)this).Authority, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfigurationInternal)this).Authority = (string) content.GetValueForProperty("Authority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfigurationInternal)this).Authority, global::System.Convert.ToString); } if (content.Contains("Audience")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfigurationInternal)this).Audience = (string[]) content.GetValueForProperty("Audience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfigurationInternal)this).Audience, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfigurationInternal)this).Audience = (System.Collections.Generic.List) content.GetValueForProperty("Audience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfigurationInternal)this).Audience, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -140,12 +148,24 @@ internal DicomServiceAuthenticationConfiguration(global::System.Management.Autom /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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(); + } } /// Authentication configuration information [System.ComponentModel.TypeConverter(typeof(DicomServiceAuthenticationConfigurationTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceAuthenticationConfiguration.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceAuthenticationConfiguration.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceAuthenticationConfiguration.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceAuthenticationConfiguration.TypeConverter.cs index 27d30781f024..0f33655f6f11 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceAuthenticationConfiguration.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceAuthenticationConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceAuthenticationConfiguration.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceAuthenticationConfiguration.cs similarity index 77% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceAuthenticationConfiguration.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceAuthenticationConfiguration.cs index bb1b87d883d9..b2c61ae58cea 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceAuthenticationConfiguration.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceAuthenticationConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Authentication configuration information public partial class DicomServiceAuthenticationConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfigurationInternal { /// Backing field for property. - private string[] _audience; + private System.Collections.Generic.List _audience; /// The audiences for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public string[] Audience { get => this._audience; } + public System.Collections.Generic.List Audience { get => this._audience; } /// Backing field for property. private string _authority; @@ -28,10 +28,10 @@ public partial class DicomServiceAuthenticationConfiguration : public string Authority { get => this._authority; } /// Internal Acessors for Audience - string[] Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfigurationInternal.Audience { get => this._audience; set { {_audience = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfigurationInternal.Audience { get => this._audience; set { {_audience = value;} } } /// Internal Acessors for Authority - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfigurationInternal.Authority { get => this._authority; set { {_authority = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfigurationInternal.Authority { get => this._authority; set { {_authority = value;} } } /// Creates an new instance. public DicomServiceAuthenticationConfiguration() @@ -47,14 +47,20 @@ public partial interface IDicomServiceAuthenticationConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The audiences for the service", SerializedName = @"audiences", PossibleTypes = new [] { typeof(string) })] - string[] Audience { get; } + System.Collections.Generic.List Audience { get; } /// The authority url for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The authority url for the service", SerializedName = @"authority", PossibleTypes = new [] { typeof(string) })] @@ -66,7 +72,7 @@ internal partial interface IDicomServiceAuthenticationConfigurationInternal { /// The audiences for the service - string[] Audience { get; set; } + System.Collections.Generic.List Audience { get; set; } /// The authority url for the service string Authority { get; set; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceAuthenticationConfiguration.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceAuthenticationConfiguration.json.cs similarity index 92% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceAuthenticationConfiguration.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceAuthenticationConfiguration.json.cs index 6c86cd7f5341..d1387e33bea7 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceAuthenticationConfiguration.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceAuthenticationConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -65,19 +65,19 @@ internal DicomServiceAuthenticationConfiguration(Microsoft.Azure.PowerShell.Cmdl { return; } - {_authority = If( json?.PropertyT("authority"), out var __jsonAuthority) ? (string)__jsonAuthority : (string)Authority;} - {_audience = If( json?.PropertyT("audiences"), out var __jsonAudiences) ? If( __jsonAudiences as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Audience;} + {_authority = If( json?.PropertyT("authority"), out var __jsonAuthority) ? (string)__jsonAuthority : (string)_authority;} + {_audience = If( json?.PropertyT("audiences"), out var __jsonAudiences) ? If( __jsonAudiences as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _audience;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new DicomServiceAuthenticationConfiguration(json) : null; } @@ -103,11 +103,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._authority)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._authority.ToString()) : null, "authority" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { if (null != this._audience) { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceCollection.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceCollection.PowerShell.cs similarity index 70% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceCollection.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceCollection.PowerShell.cs index 36ae76fd4a18..b174c6deef88 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceCollection.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceCollection.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class DicomServiceCollection partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DicomServiceCollection(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.HealthcareApis.Models.Api20211101.IDicomServiceCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DicomServiceCollection(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,17 +104,17 @@ internal DicomServiceCollection(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceCollectionInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollectionInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceTypeConverter.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. @@ -123,11 +129,11 @@ internal DicomServiceCollection(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceCollectionInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollectionInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -137,12 +143,24 @@ internal DicomServiceCollection(global::System.Management.Automation.PSObject co /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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 collection of Dicom Services. [System.ComponentModel.TypeConverter(typeof(DicomServiceCollectionTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceCollection.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceCollection.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceCollection.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceCollection.TypeConverter.cs index 593254cd722b..46d8fef06cc9 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceCollection.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceCollection.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IDicomServiceCollection ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollection ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceCollection).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollection).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceCollection.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceCollection.cs similarity index 77% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceCollection.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceCollection.cs index dfa8abf1fd2a..024fc7421c87 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceCollection.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceCollection.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The collection of Dicom Services. public partial class DicomServiceCollection : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceCollection, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceCollectionInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollection, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollectionInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class DicomServiceCollection : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService[] _value; + private System.Collections.Generic.List _value; /// The list of Dicom Services. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public DicomServiceCollection() @@ -41,6 +41,9 @@ public partial interface IDicomServiceCollection : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link used to get the next page of Dicom Services.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IDicomServiceCollection : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Dicom Services.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService) })] + System.Collections.Generic.List Value { get; set; } } /// The collection of Dicom Services. @@ -62,7 +68,7 @@ internal partial interface IDicomServiceCollectionInternal /// The link used to get the next page of Dicom Services. string NextLink { get; set; } /// The list of Dicom Services. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceCollection.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceCollection.json.cs similarity index 91% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceCollection.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceCollection.json.cs index ac6cb9a183b3..493221e71c85 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceCollection.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceCollection.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -65,19 +65,19 @@ internal DicomServiceCollection(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApi { return; } - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IDicomService) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomService.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.HealthcareApis.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.HealthcareApis.Models.IDicomService) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomService.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceCollection. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollection. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceCollection. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollection. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new DicomServiceCollection(json) : null; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServicePatchResource.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServicePatchResource.PowerShell.cs similarity index 59% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServicePatchResource.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServicePatchResource.PowerShell.cs index 75a660be68a1..9251915afec0 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServicePatchResource.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServicePatchResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class DicomServicePatchResource partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePatchResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePatchResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DicomServicePatchResource(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.HealthcareApis.Models.Api20211101.IDicomServicePatchResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePatchResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DicomServicePatchResource(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,33 +104,33 @@ internal DicomServicePatchResource(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType, global::System.Convert.ToString); } if (content.Contains("IdentityPrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); } if (content.Contains("IdentityTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("Identity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGeneratedTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1TypeConverter.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. @@ -139,27 +145,27 @@ internal DicomServicePatchResource(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType, global::System.Convert.ToString); } if (content.Contains("IdentityPrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); } if (content.Contains("IdentityTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("Identity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGeneratedTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1TypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -169,12 +175,24 @@ internal DicomServicePatchResource(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.HealthcareApis.Models.Api20211101.IDicomServicePatchResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePatchResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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(); + } } /// Dicom Service patch properties [System.ComponentModel.TypeConverter(typeof(DicomServicePatchResourceTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServicePatchResource.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServicePatchResource.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServicePatchResource.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServicePatchResource.TypeConverter.cs index 19782e644338..fb1ca6e95525 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServicePatchResource.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServicePatchResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IDicomServicePatchResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePatchResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePatchResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePatchResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServicePatchResource.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServicePatchResource.cs similarity index 60% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServicePatchResource.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServicePatchResource.cs index 13040fc2714b..cf9982c917f7 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServicePatchResource.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServicePatchResource.cs @@ -3,51 +3,51 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Dicom Service patch properties public partial class DicomServicePatchResource : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePatchResource, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePatchResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePatchResource, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePatchResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1 __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTags1(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1 __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTags1(); /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentity(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity(); /// /// Setting indicating whether the service has a managed identity associated with it. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity = value ?? null /* model class */; } /// /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; } + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; } /// /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; } + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; } /// /// Type of identity being specified, currently SystemAssigned and None are allowed. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType)""); } + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType = value ?? null; } /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM @@ -55,17 +55,20 @@ public partial class DicomServicePatchResource : /// The dictionary values can be empty objects ({}) in requests. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity = value ?? null /* model class */; } /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId = value ?? null; } /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId = value ?? null; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)__resourceTags1).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)__resourceTags1).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)__resourceTags1).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)__resourceTags1).Tag = value ?? null /* model class */; } /// Creates an new instance. public DicomServicePatchResource() @@ -90,15 +93,15 @@ public DicomServicePatchResource() /// Dicom Service patch properties public partial interface IDicomServicePatchResource : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity { } /// Dicom Service patch properties internal partial interface IDicomServicePatchResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal { } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServicePatchResource.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServicePatchResource.json.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServicePatchResource.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServicePatchResource.json.cs index 31c3f3e91fdd..6561a0088288 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServicePatchResource.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServicePatchResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -65,19 +65,19 @@ internal DicomServicePatchResource(Microsoft.Azure.PowerShell.Cmdlets.Healthcare { return; } - __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTags1(json); - __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentity(json); + __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTags1(json); + __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity(json); AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePatchResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePatchResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePatchResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePatchResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePatchResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePatchResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new DicomServicePatchResource(json) : null; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceProperties.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceProperties.PowerShell.cs similarity index 55% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceProperties.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceProperties.PowerShell.cs index 175abeba0b96..568323098694 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceProperties.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class DicomServiceProperties partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DicomServiceProperties(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.HealthcareApis.Models.Api20211101.IDicomServiceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DicomServiceProperties(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,37 +104,37 @@ internal DicomServiceProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("AuthenticationConfiguration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceAuthenticationConfigurationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceAuthenticationConfigurationTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ServiceUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).ServiceUrl = (string) content.GetValueForProperty("ServiceUrl",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).ServiceUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).ServiceUrl = (string) content.GetValueForProperty("ServiceUrl",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).ServiceUrl, global::System.Convert.ToString); } if (content.Contains("PrivateEndpointConnection")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); } if (content.Contains("PublicNetworkAccess")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).PublicNetworkAccess, global::System.Convert.ToString); } if (content.Contains("AuthenticationConfigurationAuthority")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); } if (content.Contains("AuthenticationConfigurationAudience")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).AuthenticationConfigurationAudience = (string[]) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).AuthenticationConfigurationAudience, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).AuthenticationConfigurationAudience = (System.Collections.Generic.List) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).AuthenticationConfigurationAudience, __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. @@ -143,31 +149,31 @@ internal DicomServiceProperties(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("AuthenticationConfiguration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceAuthenticationConfigurationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceAuthenticationConfigurationTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ServiceUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).ServiceUrl = (string) content.GetValueForProperty("ServiceUrl",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).ServiceUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).ServiceUrl = (string) content.GetValueForProperty("ServiceUrl",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).ServiceUrl, global::System.Convert.ToString); } if (content.Contains("PrivateEndpointConnection")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); } if (content.Contains("PublicNetworkAccess")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).PublicNetworkAccess, global::System.Convert.ToString); } if (content.Contains("AuthenticationConfigurationAuthority")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); } if (content.Contains("AuthenticationConfigurationAudience")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).AuthenticationConfigurationAudience = (string[]) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal)this).AuthenticationConfigurationAudience, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).AuthenticationConfigurationAudience = (System.Collections.Generic.List) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal)this).AuthenticationConfigurationAudience, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -177,12 +183,24 @@ internal DicomServiceProperties(global::System.Management.Automation.PSObject co /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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(); + } } /// Dicom Service properties. [System.ComponentModel.TypeConverter(typeof(DicomServicePropertiesTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceProperties.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceProperties.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceProperties.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceProperties.TypeConverter.cs index 0924a4b329e9..bd29808282c5 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceProperties.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IDicomServiceProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceProperties.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceProperties.cs similarity index 56% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceProperties.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceProperties.cs index 25dc35f070c1..d89097dc5707 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceProperties.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceProperties.cs @@ -3,71 +3,71 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Dicom Service properties. public partial class DicomServiceProperties : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceProperties, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration _authenticationConfiguration; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration _authenticationConfiguration; /// Dicom Service authentication configuration. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration AuthenticationConfiguration { get => (this._authenticationConfiguration = this._authenticationConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceAuthenticationConfiguration()); set => this._authenticationConfiguration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration AuthenticationConfiguration { get => (this._authenticationConfiguration = this._authenticationConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceAuthenticationConfiguration()); set => this._authenticationConfiguration = value; } /// The audiences for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string[] AuthenticationConfigurationAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Audience; } + public System.Collections.Generic.List AuthenticationConfigurationAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Audience; } /// The authority url for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string AuthenticationConfigurationAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Authority; } + public string AuthenticationConfigurationAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Authority; } /// Internal Acessors for AuthenticationConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal.AuthenticationConfiguration { get => (this._authenticationConfiguration = this._authenticationConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceAuthenticationConfiguration()); set { {_authenticationConfiguration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal.AuthenticationConfiguration { get => (this._authenticationConfiguration = this._authenticationConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceAuthenticationConfiguration()); set { {_authenticationConfiguration = value;} } } /// Internal Acessors for AuthenticationConfigurationAudience - string[] Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal.AuthenticationConfigurationAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Audience; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Audience = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal.AuthenticationConfigurationAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Audience; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Audience = value ?? null /* arrayOf */; } /// Internal Acessors for AuthenticationConfigurationAuthority - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal.AuthenticationConfigurationAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Authority = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal.AuthenticationConfigurationAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Authority = value ?? null; } /// Internal Acessors for PrivateEndpointConnection - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal.PrivateEndpointConnection { get => this._privateEndpointConnection; set { {_privateEndpointConnection = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal.PrivateEndpointConnection { get => this._privateEndpointConnection; set { {_privateEndpointConnection = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Internal Acessors for ServiceUrl - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePropertiesInternal.ServiceUrl { get => this._serviceUrl; set { {_serviceUrl = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServicePropertiesInternal.ServiceUrl { get => this._serviceUrl; set { {_serviceUrl = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] _privateEndpointConnection; + private System.Collections.Generic.List _privateEndpointConnection; /// The list of private endpoint connections that are set up for this resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get => this._privateEndpointConnection; } + public System.Collections.Generic.List PrivateEndpointConnection { get => this._privateEndpointConnection; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? _publicNetworkAccess; + private string _publicNetworkAccess; /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } + public string PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } /// Backing field for property. private string _serviceUrl; @@ -90,14 +90,20 @@ public partial interface IDicomServiceProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The audiences for the service", SerializedName = @"audiences", PossibleTypes = new [] { typeof(string) })] - string[] AuthenticationConfigurationAudience { get; } + System.Collections.Generic.List AuthenticationConfigurationAudience { get; } /// The authority url for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The authority url for the service", SerializedName = @"authority", PossibleTypes = new [] { typeof(string) })] @@ -106,32 +112,46 @@ public partial interface IDicomServiceProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The list of private endpoint connections that are set up for this resource.", SerializedName = @"privateEndpointConnections", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection) })] + System.Collections.Generic.List PrivateEndpointConnection { get; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } /// The url of the Dicom Services. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The url of the Dicom Services.", SerializedName = @"serviceUrl", PossibleTypes = new [] { typeof(string) })] @@ -143,19 +163,21 @@ internal partial interface IDicomServicePropertiesInternal { /// Dicom Service authentication configuration. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceAuthenticationConfiguration AuthenticationConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceAuthenticationConfiguration AuthenticationConfiguration { get; set; } /// The audiences for the service - string[] AuthenticationConfigurationAudience { get; set; } + System.Collections.Generic.List AuthenticationConfigurationAudience { get; set; } /// The authority url for the service string AuthenticationConfigurationAuthority { get; set; } /// The list of private endpoint connections that are set up for this resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + System.Collections.Generic.List PrivateEndpointConnection { get; set; } /// The provisioning state. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; set; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } /// The url of the Dicom Services. string ServiceUrl { get; set; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceProperties.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceProperties.json.cs similarity index 89% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceProperties.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceProperties.json.cs index 7b32b3ae7299..f70d23e1abf1 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/DicomServiceProperties.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/DicomServiceProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -65,22 +65,22 @@ internal DicomServiceProperties(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApi { return; } - {_authenticationConfiguration = If( json?.PropertyT("authenticationConfiguration"), out var __jsonAuthenticationConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServiceAuthenticationConfiguration.FromJson(__jsonAuthenticationConfiguration) : AuthenticationConfiguration;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_serviceUrl = If( json?.PropertyT("serviceUrl"), out var __jsonServiceUrl) ? (string)__jsonServiceUrl : (string)ServiceUrl;} - {_privateEndpointConnection = If( json?.PropertyT("privateEndpointConnections"), out var __jsonPrivateEndpointConnections) ? If( __jsonPrivateEndpointConnections as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api10.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnection.FromJson(__u) )) ))() : null : PrivateEndpointConnection;} - {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)PublicNetworkAccess;} + {_authenticationConfiguration = If( json?.PropertyT("authenticationConfiguration"), out var __jsonAuthenticationConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomServiceAuthenticationConfiguration.FromJson(__jsonAuthenticationConfiguration) : _authenticationConfiguration;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_serviceUrl = If( json?.PropertyT("serviceUrl"), out var __jsonServiceUrl) ? (string)__jsonServiceUrl : (string)_serviceUrl;} + {_privateEndpointConnection = If( json?.PropertyT("privateEndpointConnections"), out var __jsonPrivateEndpointConnections) ? If( __jsonPrivateEndpointConnections as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnection.FromJson(__u) )) ))() : null : _privateEndpointConnection;} + {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)_publicNetworkAccess;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServiceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new DicomServiceProperties(json) : null; } @@ -105,15 +105,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T return container; } AddIf( null != this._authenticationConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._authenticationConfiguration.ToJson(null,serializationMode) : null, "authenticationConfiguration" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._serviceUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._serviceUrl.ToString()) : null, "serviceUrl" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { if (null != this._privateEndpointConnection) { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Error.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Error.PowerShell.cs similarity index 69% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Error.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Error.PowerShell.cs index 1b0da243506c..f39b0c5f3c8c 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Error.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Error.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class Error partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IError DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Error(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.HealthcareApis.Models.Api20211101.IError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Error(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,25 +104,25 @@ internal Error(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal)this).Error1 = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails) content.GetValueForProperty("Error1",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal)this).Error1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.InternalErrorDetailsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal)this).Error1 = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails) content.GetValueForProperty("Error1",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal)this).Error1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.InternalErrorDetailsTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal)this).Target, 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. @@ -129,19 +137,19 @@ internal Error(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Error1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal)this).Error1 = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails) content.GetValueForProperty("Error1",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal)this).Error1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.InternalErrorDetailsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal)this).Error1 = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails) content.GetValueForProperty("Error1",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal)this).Error1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.InternalErrorDetailsTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal)this).Target, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,12 +159,24 @@ internal Error(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.HealthcareApis.Models.Api20211101.IError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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(); + } } /// Error details. [System.ComponentModel.TypeConverter(typeof(ErrorTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Error.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Error.TypeConverter.cs similarity index 98% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Error.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Error.TypeConverter.cs index bb83a7e4bb48..542518e141e3 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Error.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Error.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IError).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Error.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Error.cs similarity index 68% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Error.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Error.cs index b10809483a96..0347226bd42f 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Error.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Error.cs @@ -3,46 +3,46 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Error details. public partial class Error : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IError, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal { /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)Error1).Code; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)Error1).Code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails _error1; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails _error1; /// Error details [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails Error1 { get => (this._error1 = this._error1 ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.InternalErrorDetails()); set => this._error1 = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails Error1 { get => (this._error1 = this._error1 ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.InternalErrorDetails()); set => this._error1 = value; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)Error1).Message; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)Error1).Message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)Error1).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)Error1).Code = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)Error1).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)Error1).Code = value ?? null; } /// Internal Acessors for Error1 - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal.Error1 { get => (this._error1 = this._error1 ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.InternalErrorDetails()); set { {_error1 = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal.Error1 { get => (this._error1 = this._error1 ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.InternalErrorDetails()); set { {_error1 = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)Error1).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)Error1).Message = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)Error1).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)Error1).Message = value ?? null; } /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)Error1).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)Error1).Target = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)Error1).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)Error1).Target = value ?? null; } /// The target of the particular error. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)Error1).Target; } + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)Error1).Target; } /// Creates an new instance. public Error() @@ -58,6 +58,9 @@ public partial interface IError : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -66,6 +69,9 @@ public partial interface IError : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -74,6 +80,9 @@ public partial interface IError : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The target of the particular error.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] @@ -87,7 +96,7 @@ internal partial interface IErrorInternal /// The error code. string Code { get; set; } /// Error details - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails Error1 { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails Error1 { get; set; } /// The error message. string Message { get; set; } /// The target of the particular error. diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Error.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Error.json.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Error.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Error.json.cs index fcb08543bf81..fb1c39d62337 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Error.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Error.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -65,18 +65,16 @@ internal Error(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.Js { return; } - {_error1 = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.InternalErrorDetails.FromJson(__jsonError) : Error1;} + {_error1 = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.InternalErrorDetails.FromJson(__jsonError) : _error1;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IError. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IError. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IError FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError. + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new Error(json) : null; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ErrorDetails.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ErrorDetails.PowerShell.cs similarity index 68% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ErrorDetails.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ErrorDetails.PowerShell.cs index 6124bbceeeb8..a641e9cab398 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ErrorDetails.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ErrorDetails.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ErrorDetails partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorDetails(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.HealthcareApis.Models.Api20211101.IErrorDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorDetails(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,25 +104,25 @@ internal ErrorDetails(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.InternalErrorDetailsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.InternalErrorDetailsTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal)this).Target, 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. @@ -129,19 +137,19 @@ internal ErrorDetails(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.InternalErrorDetailsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.InternalErrorDetailsTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal)this).Target, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,12 +159,24 @@ internal ErrorDetails(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.HealthcareApis.Models.Api20211101.IErrorDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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(); + } } /// Error details. [System.ComponentModel.TypeConverter(typeof(ErrorDetailsTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ErrorDetails.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ErrorDetails.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ErrorDetails.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ErrorDetails.TypeConverter.cs index f485b589c6bf..9f60380b0883 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ErrorDetails.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ErrorDetails.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IErrorDetails ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ErrorDetails.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ErrorDetails.cs similarity index 68% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ErrorDetails.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ErrorDetails.cs index 737aefbfa5c3..6b6eb2d5b31d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ErrorDetails.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ErrorDetails.cs @@ -3,46 +3,46 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Error details. public partial class ErrorDetails : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal { /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)Error).Code; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)Error).Code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails _error; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails _error; /// Error details [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.InternalErrorDetails()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.InternalErrorDetails()); set => this._error = value; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)Error).Message; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)Error).Message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)Error).Code = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)Error).Code = value ?? null; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.InternalErrorDetails()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.InternalErrorDetails()); set { {_error = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)Error).Message = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)Error).Message = value ?? null; } /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetailsInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)Error).Target = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetailsInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)Error).Target = value ?? null; } /// The target of the particular error. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)Error).Target; } + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)Error).Target; } /// Creates an new instance. public ErrorDetails() @@ -58,6 +58,9 @@ public partial interface IErrorDetails : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -66,6 +69,9 @@ public partial interface IErrorDetails : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -74,6 +80,9 @@ public partial interface IErrorDetails : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The target of the particular error.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] @@ -87,7 +96,7 @@ internal partial interface IErrorDetailsInternal /// The error code. string Code { get; set; } /// Error details - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails Error { get; set; } /// The error message. string Message { get; set; } /// The target of the particular error. diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ErrorDetails.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ErrorDetails.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ErrorDetails.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ErrorDetails.json.cs index 638f1048e328..9653b4c44774 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ErrorDetails.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ErrorDetails.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ErrorDetails(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime. { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.InternalErrorDetails.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.InternalErrorDetails.FromJson(__jsonError) : _error;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ErrorDetails(json) : null; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirService.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirService.PowerShell.cs new file mode 100644 index 000000000000..1233c7342efe --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirService.PowerShell.cs @@ -0,0 +1,500 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + + /// The description of Fhir Service + [System.ComponentModel.TypeConverter(typeof(FhirServiceTypeConverter))] + public partial class FhirService + { + + /// + /// 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.HealthcareApis.Models.IFhirService DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FhirService(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.HealthcareApis.Models.IFhirService DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FhirService(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FhirService(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.HealthcareApis.Models.IFhirServiceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServicePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1TypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AcrConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AcrConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration) content.GetValueForProperty("AcrConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AcrConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAcrConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AuthenticationConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAuthenticationConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("CorsConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorsConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration) content.GetValueForProperty("CorsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorsConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceCorsConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ExportConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ExportConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration) content.GetValueForProperty("ExportConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ExportConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceExportConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceVersionPolicyConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ResourceVersionPolicyConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration) content.GetValueForProperty("ResourceVersionPolicyConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ResourceVersionPolicyConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AccessPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AccessPolicy = (System.Collections.Generic.List) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AccessPolicy, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAccessPolicyEntryTypeConverter.ConvertFrom)); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).PublicNetworkAccess, global::System.Convert.ToString); + } + if (content.Contains("EventState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).EventState = (string) content.GetValueForProperty("EventState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).EventState, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AcrConfigurationLoginServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AcrConfigurationLoginServer = (System.Collections.Generic.List) content.GetValueForProperty("AcrConfigurationLoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AcrConfigurationLoginServer, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AcrConfigurationOciArtifact")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AcrConfigurationOciArtifact = (System.Collections.Generic.List) content.GetValueForProperty("AcrConfigurationOciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AcrConfigurationOciArtifact, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); + } + if (content.Contains("AuthenticationConfigurationAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationAudience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AuthenticationConfigurationAudience = (string) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AuthenticationConfigurationAudience, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationSmartProxyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AuthenticationConfigurationSmartProxyEnabled = (bool?) content.GetValueForProperty("AuthenticationConfigurationSmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AuthenticationConfigurationSmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CorConfigurationOrigin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationOrigin = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationOrigin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationOrigin, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationHeader = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationHeader",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationHeader, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationMethod = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationMethod",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationMethod, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationMaxAge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationMaxAge = (int?) content.GetValueForProperty("CorConfigurationMaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationMaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CorConfigurationAllowCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationAllowCredentials = (bool?) content.GetValueForProperty("CorConfigurationAllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationAllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExportConfigurationStorageAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ExportConfigurationStorageAccountName = (string) content.GetValueForProperty("ExportConfigurationStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ExportConfigurationStorageAccountName, global::System.Convert.ToString); + } + if (content.Contains("ResourceVersionPolicyConfigurationDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ResourceVersionPolicyConfigurationDefault = (string) content.GetValueForProperty("ResourceVersionPolicyConfigurationDefault",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ResourceVersionPolicyConfigurationDefault, global::System.Convert.ToString); + } + if (content.Contains("ResourceVersionPolicyConfigurationResourceTypeOverride")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ResourceVersionPolicyConfigurationResourceTypeOverride = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides) content.GetValueForProperty("ResourceVersionPolicyConfigurationResourceTypeOverride",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ResourceVersionPolicyConfigurationResourceTypeOverride, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfigurationResourceTypeOverridesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FhirService(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.HealthcareApis.Models.IFhirServiceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServicePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1TypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AcrConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AcrConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration) content.GetValueForProperty("AcrConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AcrConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAcrConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AuthenticationConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAuthenticationConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("CorsConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorsConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration) content.GetValueForProperty("CorsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorsConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceCorsConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ExportConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ExportConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration) content.GetValueForProperty("ExportConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ExportConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceExportConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceVersionPolicyConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ResourceVersionPolicyConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration) content.GetValueForProperty("ResourceVersionPolicyConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ResourceVersionPolicyConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AccessPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AccessPolicy = (System.Collections.Generic.List) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AccessPolicy, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAccessPolicyEntryTypeConverter.ConvertFrom)); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).PublicNetworkAccess, global::System.Convert.ToString); + } + if (content.Contains("EventState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).EventState = (string) content.GetValueForProperty("EventState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).EventState, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AcrConfigurationLoginServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AcrConfigurationLoginServer = (System.Collections.Generic.List) content.GetValueForProperty("AcrConfigurationLoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AcrConfigurationLoginServer, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AcrConfigurationOciArtifact")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AcrConfigurationOciArtifact = (System.Collections.Generic.List) content.GetValueForProperty("AcrConfigurationOciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AcrConfigurationOciArtifact, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); + } + if (content.Contains("AuthenticationConfigurationAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationAudience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AuthenticationConfigurationAudience = (string) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AuthenticationConfigurationAudience, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationSmartProxyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AuthenticationConfigurationSmartProxyEnabled = (bool?) content.GetValueForProperty("AuthenticationConfigurationSmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).AuthenticationConfigurationSmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CorConfigurationOrigin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationOrigin = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationOrigin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationOrigin, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationHeader = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationHeader",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationHeader, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationMethod = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationMethod",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationMethod, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationMaxAge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationMaxAge = (int?) content.GetValueForProperty("CorConfigurationMaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationMaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CorConfigurationAllowCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationAllowCredentials = (bool?) content.GetValueForProperty("CorConfigurationAllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).CorConfigurationAllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExportConfigurationStorageAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ExportConfigurationStorageAccountName = (string) content.GetValueForProperty("ExportConfigurationStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ExportConfigurationStorageAccountName, global::System.Convert.ToString); + } + if (content.Contains("ResourceVersionPolicyConfigurationDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ResourceVersionPolicyConfigurationDefault = (string) content.GetValueForProperty("ResourceVersionPolicyConfigurationDefault",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ResourceVersionPolicyConfigurationDefault, global::System.Convert.ToString); + } + if (content.Contains("ResourceVersionPolicyConfigurationResourceTypeOverride")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ResourceVersionPolicyConfigurationResourceTypeOverride = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides) content.GetValueForProperty("ResourceVersionPolicyConfigurationResourceTypeOverride",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal)this).ResourceVersionPolicyConfigurationResourceTypeOverride, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfigurationResourceTypeOverridesTypeConverter.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.HealthcareApis.Models.IFhirService FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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 description of Fhir Service + [System.ComponentModel.TypeConverter(typeof(FhirServiceTypeConverter))] + public partial interface IFhirService + + { + + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirService.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirService.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirService.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirService.TypeConverter.cs index 510f988d1276..b6a433ad99fb 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirService.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirService.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IFhirService ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirService.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirService.cs similarity index 54% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirService.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirService.cs index c53021c94e7e..3a171faf6e65 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirService.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirService.cs @@ -3,132 +3,132 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The description of Fhir Service public partial class FhirService : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentity(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity(); /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResource __taggedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.TaggedResource(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResource __taggedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.TaggedResource(); /// Fhir Service access policies. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry[] AccessPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).AccessPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).AccessPolicy = value ?? null /* arrayOf */; } + public System.Collections.Generic.List AccessPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).AccessPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).AccessPolicy = value ?? null /* arrayOf */; } /// The list of the Azure container registry login servers. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string[] AcrConfigurationLoginServer { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).AcrConfigurationLoginServer; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).AcrConfigurationLoginServer = value ?? null /* arrayOf */; } + public System.Collections.Generic.List AcrConfigurationLoginServer { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).AcrConfigurationLoginServer; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).AcrConfigurationLoginServer = value ?? null /* arrayOf */; } /// The list of Open Container Initiative (OCI) artifacts. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).AcrConfigurationOciArtifact; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).AcrConfigurationOciArtifact = value ?? null /* arrayOf */; } + public System.Collections.Generic.List AcrConfigurationOciArtifact { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).AcrConfigurationOciArtifact; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).AcrConfigurationOciArtifact = value ?? null /* arrayOf */; } /// The audience url for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string AuthenticationConfigurationAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).AuthenticationConfigurationAudience; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).AuthenticationConfigurationAudience = value ?? null; } + public string AuthenticationConfigurationAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).AuthenticationConfigurationAudience; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).AuthenticationConfigurationAudience = value ?? null; } /// The authority url for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string AuthenticationConfigurationAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).AuthenticationConfigurationAuthority; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).AuthenticationConfigurationAuthority = value ?? null; } + public string AuthenticationConfigurationAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).AuthenticationConfigurationAuthority; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).AuthenticationConfigurationAuthority = value ?? null; } /// If the SMART on FHIR proxy is enabled [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public bool? AuthenticationConfigurationSmartProxyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).AuthenticationConfigurationSmartProxyEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).AuthenticationConfigurationSmartProxyEnabled = value ?? default(bool); } + public bool? AuthenticationConfigurationSmartProxyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).AuthenticationConfigurationSmartProxyEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).AuthenticationConfigurationSmartProxyEnabled = value ?? default(bool); } /// If credentials are allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public bool? CorConfigurationAllowCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).CorConfigurationAllowCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).CorConfigurationAllowCredentials = value ?? default(bool); } + public bool? CorConfigurationAllowCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).CorConfigurationAllowCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).CorConfigurationAllowCredentials = value ?? default(bool); } /// The headers to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string[] CorConfigurationHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).CorConfigurationHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).CorConfigurationHeader = value ?? null /* arrayOf */; } + public System.Collections.Generic.List CorConfigurationHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).CorConfigurationHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).CorConfigurationHeader = value ?? null /* arrayOf */; } /// The max age to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public int? CorConfigurationMaxAge { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).CorConfigurationMaxAge; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).CorConfigurationMaxAge = value ?? default(int); } + public int? CorConfigurationMaxAge { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).CorConfigurationMaxAge; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).CorConfigurationMaxAge = value ?? default(int); } /// The methods to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string[] CorConfigurationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).CorConfigurationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).CorConfigurationMethod = value ?? null /* arrayOf */; } + public System.Collections.Generic.List CorConfigurationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).CorConfigurationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).CorConfigurationMethod = value ?? null /* arrayOf */; } /// The origins to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string[] CorConfigurationOrigin { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).CorConfigurationOrigin; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).CorConfigurationOrigin = value ?? null /* arrayOf */; } + public System.Collections.Generic.List CorConfigurationOrigin { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).CorConfigurationOrigin; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).CorConfigurationOrigin = value ?? null /* arrayOf */; } /// /// An etag associated with the resource, used for optimistic concurrency when editing it. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Etag = value ?? null; } /// Fhir Service event support status. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState? EventState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).EventState; } + public string EventState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).EventState; } /// The name of the default export storage account. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string ExportConfigurationStorageAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).ExportConfigurationStorageAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).ExportConfigurationStorageAccountName = value ?? null; } + public string ExportConfigurationStorageAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).ExportConfigurationStorageAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).ExportConfigurationStorageAccountName = value ?? null; } /// The resource identifier. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Id; } /// /// Setting indicating whether the service has a managed identity associated with it. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity = value ?? null /* model class */; } /// /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; } + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; } /// /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; } + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; } /// /// Type of identity being specified, currently SystemAssigned and None are allowed. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType)""); } + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType = value ?? null; } /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM @@ -137,95 +137,116 @@ public partial class FhirService : /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity = value ?? null /* model class */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind? _kind; + private string _kind; /// The kind of the service. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.FormatTable(Index = 2)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind? Kind { get => this._kind; set => this._kind = value; } + public string Kind { get => this._kind; set => this._kind = value; } /// The resource location. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.FormatTable(Index = 0)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)__taggedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)__taggedResource).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)__taggedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)__taggedResource).Location = value ?? null; } /// Internal Acessors for AcrConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal.AcrConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).AcrConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).AcrConfiguration = value; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal.AcrConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).AcrConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).AcrConfiguration = value ?? null /* model class */; } /// Internal Acessors for AuthenticationConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal.AuthenticationConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).AuthenticationConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).AuthenticationConfiguration = value; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal.AuthenticationConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).AuthenticationConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).AuthenticationConfiguration = value ?? null /* model class */; } /// Internal Acessors for CorsConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal.CorsConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).CorsConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).CorsConfiguration = value; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal.CorsConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).CorsConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).CorsConfiguration = value ?? null /* model class */; } /// Internal Acessors for EventState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal.EventState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).EventState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).EventState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal.EventState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).EventState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).EventState = value ?? null; } /// Internal Acessors for ExportConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal.ExportConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).ExportConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).ExportConfiguration = value; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal.ExportConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).ExportConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).ExportConfiguration = value ?? null /* model class */; } /// Internal Acessors for PrivateEndpointConnection - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal.PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).PrivateEndpointConnection = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal.PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).PrivateEndpointConnection = value ?? null /* arrayOf */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).ProvisioningState = value ?? null; } /// Internal Acessors for ResourceVersionPolicyConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal.ResourceVersionPolicyConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).ResourceVersionPolicyConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).ResourceVersionPolicyConfiguration = value; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal.ResourceVersionPolicyConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).ResourceVersionPolicyConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).ResourceVersionPolicyConfiguration = value ?? null /* model class */; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Type = value ?? null; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity = value ?? null /* model class */; } /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId = value ?? null; } /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId = value ?? null; } /// The resource name. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.FormatTable(Index = 1)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Name; } /// The list of private endpoint connections that are set up for this resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).PrivateEndpointConnection; } + public System.Collections.Generic.List PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).PrivateEndpointConnection; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceProperties _property; /// Fhir Service configuration. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceProperties()); set => this._property = value; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).ProvisioningState; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess)""); } + public string PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).PublicNetworkAccess = value ?? null; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] @@ -235,60 +256,60 @@ public partial class FhirService : /// The default value for tracking history across all resources. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy? ResourceVersionPolicyConfigurationDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).ResourceVersionPolicyConfigurationDefault; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).ResourceVersionPolicyConfigurationDefault = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy)""); } + public string ResourceVersionPolicyConfigurationDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).ResourceVersionPolicyConfigurationDefault; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).ResourceVersionPolicyConfigurationDefault = value ?? null; } /// A list of FHIR Resources and their version policy overrides. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceVersionPolicyConfigurationResourceTypeOverride { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).ResourceVersionPolicyConfigurationResourceTypeOverride; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal)Property).ResourceVersionPolicyConfigurationResourceTypeOverride = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceVersionPolicyConfigurationResourceTypeOverride { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).ResourceVersionPolicyConfigurationResourceTypeOverride; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)Property).ResourceVersionPolicyConfigurationResourceTypeOverride = value ?? null /* model class */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData _systemData; /// Metadata pertaining to creation and last modification of the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)__taggedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)__taggedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)__taggedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)__taggedResource).Tag = value ?? null /* model class */; } /// The resource type. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Type; } /// Creates an new instance. public FhirService() @@ -313,37 +334,49 @@ public FhirService() /// The description of Fhir Service public partial interface IFhirService : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResource, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResource, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity { /// Fhir Service access policies. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fhir Service access policies.", SerializedName = @"accessPolicies", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry[] AccessPolicy { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry) })] + System.Collections.Generic.List AccessPolicy { get; set; } /// The list of the Azure container registry login servers. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of the Azure container registry login servers.", SerializedName = @"loginServers", PossibleTypes = new [] { typeof(string) })] - string[] AcrConfigurationLoginServer { get; set; } + System.Collections.Generic.List AcrConfigurationLoginServer { get; set; } /// The list of Open Container Initiative (OCI) artifacts. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Open Container Initiative (OCI) artifacts.", SerializedName = @"ociArtifacts", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry) })] + System.Collections.Generic.List AcrConfigurationOciArtifact { get; set; } /// The audience url for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The audience url for the service", SerializedName = @"audience", PossibleTypes = new [] { typeof(string) })] @@ -352,6 +385,9 @@ public partial interface IFhirService : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The authority url for the service", SerializedName = @"authority", PossibleTypes = new [] { typeof(string) })] @@ -360,6 +396,9 @@ public partial interface IFhirService : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If the SMART on FHIR proxy is enabled", SerializedName = @"smartProxyEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -368,6 +407,9 @@ public partial interface IFhirService : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If credentials are allowed via CORS.", SerializedName = @"allowCredentials", PossibleTypes = new [] { typeof(bool) })] @@ -376,14 +418,20 @@ public partial interface IFhirService : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The headers to be allowed via CORS.", SerializedName = @"headers", PossibleTypes = new [] { typeof(string) })] - string[] CorConfigurationHeader { get; set; } + System.Collections.Generic.List CorConfigurationHeader { get; set; } /// The max age to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The max age to be allowed via CORS.", SerializedName = @"maxAge", PossibleTypes = new [] { typeof(int) })] @@ -392,30 +440,43 @@ public partial interface IFhirService : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The methods to be allowed via CORS.", SerializedName = @"methods", PossibleTypes = new [] { typeof(string) })] - string[] CorConfigurationMethod { get; set; } + System.Collections.Generic.List CorConfigurationMethod { get; set; } /// The origins to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The origins to be allowed via CORS.", SerializedName = @"origins", PossibleTypes = new [] { typeof(string) })] - string[] CorConfigurationOrigin { get; set; } + System.Collections.Generic.List CorConfigurationOrigin { get; set; } /// Fhir Service event support status. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Fhir Service event support status.", SerializedName = @"eventState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState? EventState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Disabled", "Enabled", "Updating")] + string EventState { get; } /// The name of the default export storage account. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the default export storage account.", SerializedName = @"storageAccountName", PossibleTypes = new [] { typeof(string) })] @@ -424,117 +485,159 @@ public partial interface IFhirService : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The kind of the service.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind? Kind { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir-Stu3", "fhir-R4")] + string Kind { get; set; } /// The list of private endpoint connections that are set up for this resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The list of private endpoint connections that are set up for this resource.", SerializedName = @"privateEndpointConnections", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection) })] + System.Collections.Generic.List PrivateEndpointConnection { get; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } /// The default value for tracking history across all resources. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The default value for tracking history across all resources.", SerializedName = @"default", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy? ResourceVersionPolicyConfigurationDefault { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("no-version", "versioned", "versioned-update")] + string ResourceVersionPolicyConfigurationDefault { get; set; } /// A list of FHIR Resources and their version policy overrides. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of FHIR Resources and their version policy overrides.", SerializedName = @"resourceTypeOverrides", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceVersionPolicyConfigurationResourceTypeOverride { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceVersionPolicyConfigurationResourceTypeOverride { get; set; } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } + global::System.DateTime? SystemDataCreatedAt { get; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } + string SystemDataCreatedBy { get; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } + global::System.DateTime? SystemDataLastModifiedAt { get; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } + string SystemDataLastModifiedBy { get; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } } /// The description of Fhir Service internal partial interface IFhirServiceInternal : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResourceInternal, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal { /// Fhir Service access policies. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry[] AccessPolicy { get; set; } + System.Collections.Generic.List AccessPolicy { get; set; } /// Fhir Service Azure container registry configuration. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration AcrConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration AcrConfiguration { get; set; } /// The list of the Azure container registry login servers. - string[] AcrConfigurationLoginServer { get; set; } + System.Collections.Generic.List AcrConfigurationLoginServer { get; set; } /// The list of Open Container Initiative (OCI) artifacts. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get; set; } + System.Collections.Generic.List AcrConfigurationOciArtifact { get; set; } /// Fhir Service authentication configuration. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration AuthenticationConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration AuthenticationConfiguration { get; set; } /// The audience url for the service string AuthenticationConfigurationAudience { get; set; } /// The authority url for the service @@ -544,53 +647,60 @@ internal partial interface IFhirServiceInternal : /// If credentials are allowed via CORS. bool? CorConfigurationAllowCredentials { get; set; } /// The headers to be allowed via CORS. - string[] CorConfigurationHeader { get; set; } + System.Collections.Generic.List CorConfigurationHeader { get; set; } /// The max age to be allowed via CORS. int? CorConfigurationMaxAge { get; set; } /// The methods to be allowed via CORS. - string[] CorConfigurationMethod { get; set; } + System.Collections.Generic.List CorConfigurationMethod { get; set; } /// The origins to be allowed via CORS. - string[] CorConfigurationOrigin { get; set; } + System.Collections.Generic.List CorConfigurationOrigin { get; set; } /// Fhir Service Cors configuration. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration CorsConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration CorsConfiguration { get; set; } /// Fhir Service event support status. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState? EventState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Disabled", "Enabled", "Updating")] + string EventState { get; set; } /// Fhir Service export configuration. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration ExportConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration ExportConfiguration { get; set; } /// The name of the default export storage account. string ExportConfigurationStorageAccountName { get; set; } /// The kind of the service. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind? Kind { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir-Stu3", "fhir-R4")] + string Kind { get; set; } /// The list of private endpoint connections that are set up for this resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + System.Collections.Generic.List PrivateEndpointConnection { get; set; } /// Fhir Service configuration. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceProperties Property { get; set; } /// The provisioning state. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; set; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } /// Determines tracking of history for resources. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration ResourceVersionPolicyConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration ResourceVersionPolicyConfiguration { get; set; } /// The default value for tracking history across all resources. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy? ResourceVersionPolicyConfigurationDefault { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("no-version", "versioned", "versioned-update")] + string ResourceVersionPolicyConfigurationDefault { get; set; } /// A list of FHIR Resources and their version policy overrides. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceVersionPolicyConfigurationResourceTypeOverride { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceVersionPolicyConfigurationResourceTypeOverride { get; set; } /// Metadata pertaining to creation and last modification of the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData SystemData { get; set; } /// The timestamp of resource creation (UTC). global::System.DateTime? SystemDataCreatedAt { get; set; } /// The identity that created the resource. string SystemDataCreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// The identity that last modified the resource. string SystemDataLastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirService.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirService.json.cs similarity index 92% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirService.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirService.json.cs index 1f70ab3b436c..3f1a47e2fed5 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirService.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirService.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -65,22 +65,22 @@ internal FhirService(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.J { return; } - __taggedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.TaggedResource(json); - __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentity(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceProperties.FromJson(__jsonProperties) : Property;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData.FromJson(__jsonSystemData) : SystemData;} - {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + __taggedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.TaggedResource(json); + __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceProperties.FromJson(__jsonProperties) : _property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)_kind;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new FhirService(json) : null; } @@ -107,7 +107,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T __taggedResource?.ToJson(container, serializationMode); __serviceManagedIdentity?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAccessPolicyEntry.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAccessPolicyEntry.PowerShell.cs similarity index 76% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAccessPolicyEntry.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAccessPolicyEntry.PowerShell.cs index 44a7d6adf0e3..1be12845c914 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAccessPolicyEntry.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAccessPolicyEntry.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class FhirServiceAccessPolicyEntry partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new FhirServiceAccessPolicyEntry(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.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new FhirServiceAccessPolicyEntry(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,13 +104,13 @@ internal FhirServiceAccessPolicyEntry(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("ObjectId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntryInternal)this).ObjectId = (string) content.GetValueForProperty("ObjectId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntryInternal)this).ObjectId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntryInternal)this).ObjectId = (string) content.GetValueForProperty("ObjectId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntryInternal)this).ObjectId, 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,7 +125,7 @@ internal FhirServiceAccessPolicyEntry(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("ObjectId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntryInternal)this).ObjectId = (string) content.GetValueForProperty("ObjectId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntryInternal)this).ObjectId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntryInternal)this).ObjectId = (string) content.GetValueForProperty("ObjectId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntryInternal)this).ObjectId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -129,12 +135,24 @@ internal FhirServiceAccessPolicyEntry(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.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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 access policy entry. [System.ComponentModel.TypeConverter(typeof(FhirServiceAccessPolicyEntryTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAccessPolicyEntry.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAccessPolicyEntry.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAccessPolicyEntry.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAccessPolicyEntry.TypeConverter.cs index 07afa7244a73..4bb135fda07e 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAccessPolicyEntry.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAccessPolicyEntry.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAccessPolicyEntry.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAccessPolicyEntry.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAccessPolicyEntry.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAccessPolicyEntry.cs index cb1c4d7adda2..8c373e0619cf 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAccessPolicyEntry.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAccessPolicyEntry.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// An access policy entry. public partial class FhirServiceAccessPolicyEntry : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntryInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntryInternal { /// Backing field for property. @@ -38,6 +38,9 @@ public partial interface IFhirServiceAccessPolicyEntry : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"An Azure AD object ID (User or Apps) that is allowed access to the FHIR service.", SerializedName = @"objectId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAccessPolicyEntry.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAccessPolicyEntry.json.cs similarity index 95% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAccessPolicyEntry.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAccessPolicyEntry.json.cs index 296a1980edd2..3632f7dd0a9a 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAccessPolicyEntry.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAccessPolicyEntry.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -65,18 +65,18 @@ internal FhirServiceAccessPolicyEntry(Microsoft.Azure.PowerShell.Cmdlets.Healthc { return; } - {_objectId = If( json?.PropertyT("objectId"), out var __jsonObjectId) ? (string)__jsonObjectId : (string)ObjectId;} + {_objectId = If( json?.PropertyT("objectId"), out var __jsonObjectId) ? (string)__jsonObjectId : (string)_objectId;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new FhirServiceAccessPolicyEntry(json) : null; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAcrConfiguration.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAcrConfiguration.PowerShell.cs similarity index 67% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAcrConfiguration.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAcrConfiguration.PowerShell.cs index 31ca9ebe3a19..9f85112d21a2 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAcrConfiguration.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAcrConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class FhirServiceAcrConfiguration partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new FhirServiceAcrConfiguration(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.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new FhirServiceAcrConfiguration(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,17 +104,17 @@ internal FhirServiceAcrConfiguration(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("LoginServer")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfigurationInternal)this).LoginServer = (string[]) content.GetValueForProperty("LoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfigurationInternal)this).LoginServer, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfigurationInternal)this).LoginServer = (System.Collections.Generic.List) content.GetValueForProperty("LoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfigurationInternal)this).LoginServer, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("OciArtifact")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfigurationInternal)this).OciArtifact = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]) content.GetValueForProperty("OciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfigurationInternal)this).OciArtifact, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfigurationInternal)this).OciArtifact = (System.Collections.Generic.List) content.GetValueForProperty("OciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfigurationInternal)this).OciArtifact, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceOciArtifactEntryTypeConverter.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. @@ -123,11 +129,11 @@ internal FhirServiceAcrConfiguration(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("LoginServer")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfigurationInternal)this).LoginServer = (string[]) content.GetValueForProperty("LoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfigurationInternal)this).LoginServer, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfigurationInternal)this).LoginServer = (System.Collections.Generic.List) content.GetValueForProperty("LoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfigurationInternal)this).LoginServer, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("OciArtifact")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfigurationInternal)this).OciArtifact = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]) content.GetValueForProperty("OciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfigurationInternal)this).OciArtifact, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfigurationInternal)this).OciArtifact = (System.Collections.Generic.List) content.GetValueForProperty("OciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfigurationInternal)this).OciArtifact, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -137,12 +143,24 @@ internal FhirServiceAcrConfiguration(global::System.Management.Automation.PSObje /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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(); + } } /// Azure container registry configuration information [System.ComponentModel.TypeConverter(typeof(FhirServiceAcrConfigurationTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAcrConfiguration.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAcrConfiguration.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAcrConfiguration.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAcrConfiguration.TypeConverter.cs index 417b48e8b811..25f37727c42e 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAcrConfiguration.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAcrConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAcrConfiguration.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAcrConfiguration.cs similarity index 69% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAcrConfiguration.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAcrConfiguration.cs index 84d0d35d69da..513394278c17 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAcrConfiguration.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAcrConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Azure container registry configuration information public partial class FhirServiceAcrConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfigurationInternal { /// Backing field for property. - private string[] _loginServer; + private System.Collections.Generic.List _loginServer; /// The list of the Azure container registry login servers. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public string[] LoginServer { get => this._loginServer; set => this._loginServer = value; } + public System.Collections.Generic.List LoginServer { get => this._loginServer; set => this._loginServer = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] _ociArtifact; + private System.Collections.Generic.List _ociArtifact; /// The list of Open Container Initiative (OCI) artifacts. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] OciArtifact { get => this._ociArtifact; set => this._ociArtifact = value; } + public System.Collections.Generic.List OciArtifact { get => this._ociArtifact; set => this._ociArtifact = value; } /// Creates an new instance. public FhirServiceAcrConfiguration() @@ -41,18 +41,24 @@ public partial interface IFhirServiceAcrConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of the Azure container registry login servers.", SerializedName = @"loginServers", PossibleTypes = new [] { typeof(string) })] - string[] LoginServer { get; set; } + System.Collections.Generic.List LoginServer { get; set; } /// The list of Open Container Initiative (OCI) artifacts. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Open Container Initiative (OCI) artifacts.", SerializedName = @"ociArtifacts", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] OciArtifact { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry) })] + System.Collections.Generic.List OciArtifact { get; set; } } /// Azure container registry configuration information @@ -60,9 +66,9 @@ internal partial interface IFhirServiceAcrConfigurationInternal { /// The list of the Azure container registry login servers. - string[] LoginServer { get; set; } + System.Collections.Generic.List LoginServer { get; set; } /// The list of Open Container Initiative (OCI) artifacts. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] OciArtifact { get; set; } + System.Collections.Generic.List OciArtifact { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAcrConfiguration.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAcrConfiguration.json.cs similarity index 87% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAcrConfiguration.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAcrConfiguration.json.cs index 369a95782229..2cb02c0f2307 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAcrConfiguration.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAcrConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -65,19 +65,19 @@ internal FhirServiceAcrConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Healthca { return; } - {_loginServer = If( json?.PropertyT("loginServers"), out var __jsonLoginServers) ? If( __jsonLoginServers as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : LoginServer;} - {_ociArtifact = If( json?.PropertyT("ociArtifacts"), out var __jsonOciArtifacts) ? If( __jsonOciArtifacts as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceOciArtifactEntry.FromJson(__p) )) ))() : null : OciArtifact;} + {_loginServer = If( json?.PropertyT("loginServers"), out var __jsonLoginServers) ? If( __jsonLoginServers as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _loginServer;} + {_ociArtifact = If( json?.PropertyT("ociArtifacts"), out var __jsonOciArtifacts) ? If( __jsonOciArtifacts as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IServiceOciArtifactEntry) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceOciArtifactEntry.FromJson(__p) )) ))() : null : _ociArtifact;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new FhirServiceAcrConfiguration(json) : null; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAuthenticationConfiguration.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAuthenticationConfiguration.PowerShell.cs similarity index 69% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAuthenticationConfiguration.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAuthenticationConfiguration.PowerShell.cs index 3386b8313847..61c150c43ed2 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAuthenticationConfiguration.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAuthenticationConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,35 +55,43 @@ public partial class FhirServiceAuthenticationConfiguration partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new FhirServiceAuthenticationConfiguration(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 . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new FhirServiceAuthenticationConfiguration(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,21 +106,21 @@ internal FhirServiceAuthenticationConfiguration(global::System.Collections.IDict // actually deserialize if (content.Contains("Authority")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal)this).Authority = (string) content.GetValueForProperty("Authority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal)this).Authority, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal)this).Authority = (string) content.GetValueForProperty("Authority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal)this).Authority, global::System.Convert.ToString); } if (content.Contains("Audience")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal)this).Audience = (string) content.GetValueForProperty("Audience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal)this).Audience, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal)this).Audience = (string) content.GetValueForProperty("Audience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal)this).Audience, global::System.Convert.ToString); } if (content.Contains("SmartProxyEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal)this).SmartProxyEnabled = (bool?) content.GetValueForProperty("SmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal)this).SmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal)this).SmartProxyEnabled = (bool?) content.GetValueForProperty("SmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal)this).SmartProxyEnabled, (__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. @@ -127,15 +135,15 @@ internal FhirServiceAuthenticationConfiguration(global::System.Management.Automa // actually deserialize if (content.Contains("Authority")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal)this).Authority = (string) content.GetValueForProperty("Authority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal)this).Authority, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal)this).Authority = (string) content.GetValueForProperty("Authority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal)this).Authority, global::System.Convert.ToString); } if (content.Contains("Audience")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal)this).Audience = (string) content.GetValueForProperty("Audience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal)this).Audience, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal)this).Audience = (string) content.GetValueForProperty("Audience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal)this).Audience, global::System.Convert.ToString); } if (content.Contains("SmartProxyEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal)this).SmartProxyEnabled = (bool?) content.GetValueForProperty("SmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal)this).SmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal)this).SmartProxyEnabled = (bool?) content.GetValueForProperty("SmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal)this).SmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -148,12 +156,24 @@ internal FhirServiceAuthenticationConfiguration(global::System.Management.Automa /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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(); + } } /// Authentication configuration information [System.ComponentModel.TypeConverter(typeof(FhirServiceAuthenticationConfigurationTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAuthenticationConfiguration.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAuthenticationConfiguration.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAuthenticationConfiguration.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAuthenticationConfiguration.TypeConverter.cs index 0c767a9a7523..e36e00368586 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAuthenticationConfiguration.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAuthenticationConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAuthenticationConfiguration.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAuthenticationConfiguration.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAuthenticationConfiguration.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAuthenticationConfiguration.cs index 305bf60768b6..71cfdde06b5e 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAuthenticationConfiguration.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAuthenticationConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Authentication configuration information public partial class FhirServiceAuthenticationConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IFhirServiceAuthenticationConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The audience url for the service", SerializedName = @"audience", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IFhirServiceAuthenticationConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The authority url for the service", SerializedName = @"authority", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IFhirServiceAuthenticationConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If the SMART on FHIR proxy is enabled", SerializedName = @"smartProxyEnabled", PossibleTypes = new [] { typeof(bool) })] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAuthenticationConfiguration.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAuthenticationConfiguration.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAuthenticationConfiguration.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAuthenticationConfiguration.json.cs index b4b30c155a46..317defd393da 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceAuthenticationConfiguration.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceAuthenticationConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -65,20 +65,20 @@ internal FhirServiceAuthenticationConfiguration(Microsoft.Azure.PowerShell.Cmdle { return; } - {_authority = If( json?.PropertyT("authority"), out var __jsonAuthority) ? (string)__jsonAuthority : (string)Authority;} - {_audience = If( json?.PropertyT("audience"), out var __jsonAudience) ? (string)__jsonAudience : (string)Audience;} - {_smartProxyEnabled = If( json?.PropertyT("smartProxyEnabled"), out var __jsonSmartProxyEnabled) ? (bool?)__jsonSmartProxyEnabled : SmartProxyEnabled;} + {_authority = If( json?.PropertyT("authority"), out var __jsonAuthority) ? (string)__jsonAuthority : (string)_authority;} + {_audience = If( json?.PropertyT("audience"), out var __jsonAudience) ? (string)__jsonAudience : (string)_audience;} + {_smartProxyEnabled = If( json?.PropertyT("smartProxyEnabled"), out var __jsonSmartProxyEnabled) ? (bool?)__jsonSmartProxyEnabled : _smartProxyEnabled;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new FhirServiceAuthenticationConfiguration(json) : null; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCollection.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCollection.PowerShell.cs similarity index 70% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCollection.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCollection.PowerShell.cs index 0ba62b60c221..de4a628004a9 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCollection.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCollection.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class FhirServiceCollection partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new FhirServiceCollection(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.HealthcareApis.Models.Api20211101.IFhirServiceCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new FhirServiceCollection(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,17 +104,17 @@ internal FhirServiceCollection(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCollectionInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollectionInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceTypeConverter.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. @@ -123,11 +129,11 @@ internal FhirServiceCollection(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCollectionInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollectionInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -137,12 +143,24 @@ internal FhirServiceCollection(global::System.Management.Automation.PSObject con /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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 collection of Fhir services. [System.ComponentModel.TypeConverter(typeof(FhirServiceCollectionTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCollection.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCollection.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCollection.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCollection.TypeConverter.cs index 931f10f08361..ccb3c41307a0 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCollection.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCollection.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IFhirServiceCollection ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollection ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCollection).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollection).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCollection.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCollection.cs similarity index 77% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCollection.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCollection.cs index 765bd45d1f8d..cecd1b4fa2e8 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCollection.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCollection.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// A collection of Fhir services. public partial class FhirServiceCollection : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCollection, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCollectionInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollection, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollectionInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class FhirServiceCollection : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService[] _value; + private System.Collections.Generic.List _value; /// The list of Fhir Services. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public FhirServiceCollection() @@ -41,6 +41,9 @@ public partial interface IFhirServiceCollection : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link used to get the next page of Fhir Services.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IFhirServiceCollection : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Fhir Services.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService) })] + System.Collections.Generic.List Value { get; set; } } /// A collection of Fhir services. @@ -62,7 +68,7 @@ internal partial interface IFhirServiceCollectionInternal /// The link used to get the next page of Fhir Services. string NextLink { get; set; } /// The list of Fhir Services. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCollection.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCollection.json.cs similarity index 91% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCollection.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCollection.json.cs index 5dfaf3e25015..1372c012b4fd 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCollection.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCollection.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -65,19 +65,19 @@ internal FhirServiceCollection(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis { return; } - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IFhirService) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirService.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.HealthcareApis.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.HealthcareApis.Models.IFhirService) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirService.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCollection. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollection. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCollection. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollection. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new FhirServiceCollection(json) : null; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCorsConfiguration.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCorsConfiguration.PowerShell.cs similarity index 62% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCorsConfiguration.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCorsConfiguration.PowerShell.cs index c1b3ca338d2e..54531d944a6a 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCorsConfiguration.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCorsConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class FhirServiceCorsConfiguration partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new FhirServiceCorsConfiguration(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.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new FhirServiceCorsConfiguration(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,29 +104,29 @@ internal FhirServiceCorsConfiguration(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("Origin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).Origin = (string[]) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).Origin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).Origin = (System.Collections.Generic.List) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).Origin, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Header")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).Header = (string[]) content.GetValueForProperty("Header",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).Header, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).Header = (System.Collections.Generic.List) content.GetValueForProperty("Header",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).Header, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Method")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).Method = (string[]) content.GetValueForProperty("Method",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).Method, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).Method = (System.Collections.Generic.List) content.GetValueForProperty("Method",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).Method, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("MaxAge")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).MaxAge = (int?) content.GetValueForProperty("MaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).MaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).MaxAge = (int?) content.GetValueForProperty("MaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).MaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("AllowCredentials")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).AllowCredentials = (bool?) content.GetValueForProperty("AllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).AllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).AllowCredentials = (bool?) content.GetValueForProperty("AllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).AllowCredentials, (__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. @@ -135,23 +141,23 @@ internal FhirServiceCorsConfiguration(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("Origin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).Origin = (string[]) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).Origin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).Origin = (System.Collections.Generic.List) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).Origin, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Header")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).Header = (string[]) content.GetValueForProperty("Header",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).Header, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).Header = (System.Collections.Generic.List) content.GetValueForProperty("Header",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).Header, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Method")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).Method = (string[]) content.GetValueForProperty("Method",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).Method, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).Method = (System.Collections.Generic.List) content.GetValueForProperty("Method",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).Method, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("MaxAge")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).MaxAge = (int?) content.GetValueForProperty("MaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).MaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).MaxAge = (int?) content.GetValueForProperty("MaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).MaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("AllowCredentials")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).AllowCredentials = (bool?) content.GetValueForProperty("AllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)this).AllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).AllowCredentials = (bool?) content.GetValueForProperty("AllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)this).AllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -161,12 +167,24 @@ internal FhirServiceCorsConfiguration(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.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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 settings for the CORS configuration of the service instance. [System.ComponentModel.TypeConverter(typeof(FhirServiceCorsConfigurationTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCorsConfiguration.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCorsConfiguration.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCorsConfiguration.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCorsConfiguration.TypeConverter.cs index af1b526efeac..66b193c15e36 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCorsConfiguration.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCorsConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCorsConfiguration.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCorsConfiguration.cs similarity index 79% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCorsConfiguration.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCorsConfiguration.cs index 2ab9d07c0e00..254739a9b654 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCorsConfiguration.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCorsConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The settings for the CORS configuration of the service instance. public partial class FhirServiceCorsConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class FhirServiceCorsConfiguration : public bool? AllowCredentials { get => this._allowCredentials; set => this._allowCredentials = value; } /// Backing field for property. - private string[] _header; + private System.Collections.Generic.List _header; /// The headers to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public string[] Header { get => this._header; set => this._header = value; } + public System.Collections.Generic.List Header { get => this._header; set => this._header = value; } /// Backing field for property. private int? _maxAge; @@ -35,18 +35,18 @@ public partial class FhirServiceCorsConfiguration : public int? MaxAge { get => this._maxAge; set => this._maxAge = value; } /// Backing field for property. - private string[] _method; + private System.Collections.Generic.List _method; /// The methods to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public string[] Method { get => this._method; set => this._method = value; } + public System.Collections.Generic.List Method { get => this._method; set => this._method = value; } /// Backing field for property. - private string[] _origin; + private System.Collections.Generic.List _origin; /// The origins to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public string[] Origin { get => this._origin; set => this._origin = value; } + public System.Collections.Generic.List Origin { get => this._origin; set => this._origin = value; } /// Creates an new instance. public FhirServiceCorsConfiguration() @@ -62,6 +62,9 @@ public partial interface IFhirServiceCorsConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If credentials are allowed via CORS.", SerializedName = @"allowCredentials", PossibleTypes = new [] { typeof(bool) })] @@ -70,14 +73,20 @@ public partial interface IFhirServiceCorsConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The headers to be allowed via CORS.", SerializedName = @"headers", PossibleTypes = new [] { typeof(string) })] - string[] Header { get; set; } + System.Collections.Generic.List Header { get; set; } /// The max age to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The max age to be allowed via CORS.", SerializedName = @"maxAge", PossibleTypes = new [] { typeof(int) })] @@ -86,18 +95,24 @@ public partial interface IFhirServiceCorsConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The methods to be allowed via CORS.", SerializedName = @"methods", PossibleTypes = new [] { typeof(string) })] - string[] Method { get; set; } + System.Collections.Generic.List Method { get; set; } /// The origins to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The origins to be allowed via CORS.", SerializedName = @"origins", PossibleTypes = new [] { typeof(string) })] - string[] Origin { get; set; } + System.Collections.Generic.List Origin { get; set; } } /// The settings for the CORS configuration of the service instance. @@ -107,13 +122,13 @@ internal partial interface IFhirServiceCorsConfigurationInternal /// If credentials are allowed via CORS. bool? AllowCredentials { get; set; } /// The headers to be allowed via CORS. - string[] Header { get; set; } + System.Collections.Generic.List Header { get; set; } /// The max age to be allowed via CORS. int? MaxAge { get; set; } /// The methods to be allowed via CORS. - string[] Method { get; set; } + System.Collections.Generic.List Method { get; set; } /// The origins to be allowed via CORS. - string[] Origin { get; set; } + System.Collections.Generic.List Origin { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCorsConfiguration.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCorsConfiguration.json.cs similarity index 87% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCorsConfiguration.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCorsConfiguration.json.cs index 6bee7bbb1dd1..7f9f9d64cca8 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceCorsConfiguration.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceCorsConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -65,22 +65,22 @@ internal FhirServiceCorsConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Healthc { return; } - {_origin = If( json?.PropertyT("origins"), out var __jsonOrigins) ? If( __jsonOrigins as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Origin;} - {_header = If( json?.PropertyT("headers"), out var __jsonHeaders) ? If( __jsonHeaders as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : Header;} - {_method = If( json?.PropertyT("methods"), out var __jsonMethods) ? If( __jsonMethods as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : Method;} - {_maxAge = If( json?.PropertyT("maxAge"), out var __jsonMaxAge) ? (int?)__jsonMaxAge : MaxAge;} - {_allowCredentials = If( json?.PropertyT("allowCredentials"), out var __jsonAllowCredentials) ? (bool?)__jsonAllowCredentials : AllowCredentials;} + {_origin = If( json?.PropertyT("origins"), out var __jsonOrigins) ? If( __jsonOrigins as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _origin;} + {_header = If( json?.PropertyT("headers"), out var __jsonHeaders) ? If( __jsonHeaders as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _header;} + {_method = If( json?.PropertyT("methods"), out var __jsonMethods) ? If( __jsonMethods as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : _method;} + {_maxAge = If( json?.PropertyT("maxAge"), out var __jsonMaxAge) ? (int?)__jsonMaxAge : _maxAge;} + {_allowCredentials = If( json?.PropertyT("allowCredentials"), out var __jsonAllowCredentials) ? (bool?)__jsonAllowCredentials : _allowCredentials;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new FhirServiceCorsConfiguration(json) : null; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceExportConfiguration.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceExportConfiguration.PowerShell.cs similarity index 76% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceExportConfiguration.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceExportConfiguration.PowerShell.cs index 22d04e70039f..d904c629eb44 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceExportConfiguration.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceExportConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class FhirServiceExportConfiguration partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new FhirServiceExportConfiguration(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.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new FhirServiceExportConfiguration(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,13 +104,13 @@ internal FhirServiceExportConfiguration(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("StorageAccountName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfigurationInternal)this).StorageAccountName = (string) content.GetValueForProperty("StorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfigurationInternal)this).StorageAccountName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfigurationInternal)this).StorageAccountName = (string) content.GetValueForProperty("StorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfigurationInternal)this).StorageAccountName, 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,7 +125,7 @@ internal FhirServiceExportConfiguration(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("StorageAccountName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfigurationInternal)this).StorageAccountName = (string) content.GetValueForProperty("StorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfigurationInternal)this).StorageAccountName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfigurationInternal)this).StorageAccountName = (string) content.GetValueForProperty("StorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfigurationInternal)this).StorageAccountName, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -129,12 +135,24 @@ internal FhirServiceExportConfiguration(global::System.Management.Automation.PSO /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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(); + } } /// Export operation configuration information [System.ComponentModel.TypeConverter(typeof(FhirServiceExportConfigurationTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceExportConfiguration.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceExportConfiguration.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceExportConfiguration.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceExportConfiguration.TypeConverter.cs index 362ba3deaa66..7451b15b7205 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceExportConfiguration.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceExportConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceExportConfiguration.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceExportConfiguration.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceExportConfiguration.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceExportConfiguration.cs index 3a54b42d7af8..9d1d37576f2a 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceExportConfiguration.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceExportConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Export operation configuration information public partial class FhirServiceExportConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfigurationInternal { /// Backing field for property. @@ -34,6 +34,9 @@ public partial interface IFhirServiceExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the default export storage account.", SerializedName = @"storageAccountName", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceExportConfiguration.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceExportConfiguration.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceExportConfiguration.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceExportConfiguration.json.cs index a1e8acebd7ae..2523b51dcfb3 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceExportConfiguration.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceExportConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -65,18 +65,18 @@ internal FhirServiceExportConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Healt { return; } - {_storageAccountName = If( json?.PropertyT("storageAccountName"), out var __jsonStorageAccountName) ? (string)__jsonStorageAccountName : (string)StorageAccountName;} + {_storageAccountName = If( json?.PropertyT("storageAccountName"), out var __jsonStorageAccountName) ? (string)__jsonStorageAccountName : (string)_storageAccountName;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new FhirServiceExportConfiguration(json) : null; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServicePatchResource.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServicePatchResource.PowerShell.cs similarity index 59% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServicePatchResource.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServicePatchResource.PowerShell.cs index ca6049cd9c64..e50404e1f7a4 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServicePatchResource.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServicePatchResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class FhirServicePatchResource partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePatchResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePatchResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new FhirServicePatchResource(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.HealthcareApis.Models.Api20211101.IFhirServicePatchResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePatchResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new FhirServicePatchResource(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,33 +104,33 @@ internal FhirServicePatchResource(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType, global::System.Convert.ToString); } if (content.Contains("IdentityPrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); } if (content.Contains("IdentityTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("Identity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGeneratedTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1TypeConverter.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. @@ -139,27 +145,27 @@ internal FhirServicePatchResource(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType, global::System.Convert.ToString); } if (content.Contains("IdentityPrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); } if (content.Contains("IdentityTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("Identity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGeneratedTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1TypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -169,12 +175,24 @@ internal FhirServicePatchResource(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.HealthcareApis.Models.Api20211101.IFhirServicePatchResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePatchResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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(); + } } /// FhirService patch properties [System.ComponentModel.TypeConverter(typeof(FhirServicePatchResourceTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServicePatchResource.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServicePatchResource.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServicePatchResource.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServicePatchResource.TypeConverter.cs index 69f76f9985cf..8210858ea04f 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServicePatchResource.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServicePatchResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IFhirServicePatchResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePatchResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePatchResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePatchResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServicePatchResource.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServicePatchResource.cs similarity index 60% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServicePatchResource.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServicePatchResource.cs index 9ff44c388df7..df69e0c14b0d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServicePatchResource.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServicePatchResource.cs @@ -3,51 +3,51 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// FhirService patch properties public partial class FhirServicePatchResource : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePatchResource, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePatchResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePatchResource, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePatchResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1 __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTags1(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1 __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTags1(); /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentity(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity(); /// /// Setting indicating whether the service has a managed identity associated with it. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity = value ?? null /* model class */; } /// /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; } + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; } /// /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; } + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; } /// /// Type of identity being specified, currently SystemAssigned and None are allowed. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType)""); } + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType = value ?? null; } /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM @@ -55,17 +55,20 @@ public partial class FhirServicePatchResource : /// The dictionary values can be empty objects ({}) in requests. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity = value ?? null /* model class */; } /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId = value ?? null; } /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId = value ?? null; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)__resourceTags1).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)__resourceTags1).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)__resourceTags1).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)__resourceTags1).Tag = value ?? null /* model class */; } /// Creates an new instance. public FhirServicePatchResource() @@ -90,15 +93,15 @@ public FhirServicePatchResource() /// FhirService patch properties public partial interface IFhirServicePatchResource : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity { } /// FhirService patch properties internal partial interface IFhirServicePatchResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal { } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServicePatchResource.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServicePatchResource.json.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServicePatchResource.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServicePatchResource.json.cs index b8fd5cedfdea..7f7aa5be37aa 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServicePatchResource.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServicePatchResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -65,19 +65,19 @@ internal FhirServicePatchResource(Microsoft.Azure.PowerShell.Cmdlets.HealthcareA { return; } - __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTags1(json); - __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentity(json); + __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTags1(json); + __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity(json); AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePatchResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePatchResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePatchResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePatchResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePatchResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePatchResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new FhirServicePatchResource(json) : null; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceProperties.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceProperties.PowerShell.cs new file mode 100644 index 000000000000..578f503428d3 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceProperties.PowerShell.cs @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + + /// Fhir Service properties. + [System.ComponentModel.TypeConverter(typeof(FhirServicePropertiesTypeConverter))] + public partial class FhirServiceProperties + { + + /// + /// 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.HealthcareApis.Models.IFhirServiceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FhirServiceProperties(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.HealthcareApis.Models.IFhirServiceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FhirServiceProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FhirServiceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AcrConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AcrConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration) content.GetValueForProperty("AcrConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AcrConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAcrConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AuthenticationConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAuthenticationConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("CorsConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorsConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration) content.GetValueForProperty("CorsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorsConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceCorsConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ExportConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ExportConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration) content.GetValueForProperty("ExportConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ExportConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceExportConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceVersionPolicyConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration) content.GetValueForProperty("ResourceVersionPolicyConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("AccessPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AccessPolicy = (System.Collections.Generic.List) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AccessPolicy, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAccessPolicyEntryTypeConverter.ConvertFrom)); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).PublicNetworkAccess, global::System.Convert.ToString); + } + if (content.Contains("EventState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).EventState = (string) content.GetValueForProperty("EventState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).EventState, global::System.Convert.ToString); + } + if (content.Contains("AcrConfigurationLoginServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AcrConfigurationLoginServer = (System.Collections.Generic.List) content.GetValueForProperty("AcrConfigurationLoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AcrConfigurationLoginServer, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AcrConfigurationOciArtifact")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AcrConfigurationOciArtifact = (System.Collections.Generic.List) content.GetValueForProperty("AcrConfigurationOciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AcrConfigurationOciArtifact, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); + } + if (content.Contains("AuthenticationConfigurationAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationAudience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AuthenticationConfigurationAudience = (string) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AuthenticationConfigurationAudience, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationSmartProxyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AuthenticationConfigurationSmartProxyEnabled = (bool?) content.GetValueForProperty("AuthenticationConfigurationSmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AuthenticationConfigurationSmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CorConfigurationOrigin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationOrigin = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationOrigin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationOrigin, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationHeader = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationHeader",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationHeader, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationMethod = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationMethod",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationMethod, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationMaxAge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationMaxAge = (int?) content.GetValueForProperty("CorConfigurationMaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationMaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CorConfigurationAllowCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationAllowCredentials = (bool?) content.GetValueForProperty("CorConfigurationAllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationAllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExportConfigurationStorageAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ExportConfigurationStorageAccountName = (string) content.GetValueForProperty("ExportConfigurationStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ExportConfigurationStorageAccountName, global::System.Convert.ToString); + } + if (content.Contains("ResourceVersionPolicyConfigurationDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfigurationDefault = (string) content.GetValueForProperty("ResourceVersionPolicyConfigurationDefault",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfigurationDefault, global::System.Convert.ToString); + } + if (content.Contains("ResourceVersionPolicyConfigurationResourceTypeOverride")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfigurationResourceTypeOverride = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides) content.GetValueForProperty("ResourceVersionPolicyConfigurationResourceTypeOverride",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfigurationResourceTypeOverride, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfigurationResourceTypeOverridesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FhirServiceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AcrConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AcrConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration) content.GetValueForProperty("AcrConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AcrConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAcrConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AuthenticationConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAuthenticationConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("CorsConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorsConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration) content.GetValueForProperty("CorsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorsConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceCorsConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ExportConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ExportConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration) content.GetValueForProperty("ExportConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ExportConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceExportConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceVersionPolicyConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration) content.GetValueForProperty("ResourceVersionPolicyConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("AccessPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AccessPolicy = (System.Collections.Generic.List) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AccessPolicy, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAccessPolicyEntryTypeConverter.ConvertFrom)); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).PublicNetworkAccess, global::System.Convert.ToString); + } + if (content.Contains("EventState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).EventState = (string) content.GetValueForProperty("EventState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).EventState, global::System.Convert.ToString); + } + if (content.Contains("AcrConfigurationLoginServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AcrConfigurationLoginServer = (System.Collections.Generic.List) content.GetValueForProperty("AcrConfigurationLoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AcrConfigurationLoginServer, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AcrConfigurationOciArtifact")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AcrConfigurationOciArtifact = (System.Collections.Generic.List) content.GetValueForProperty("AcrConfigurationOciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AcrConfigurationOciArtifact, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); + } + if (content.Contains("AuthenticationConfigurationAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationAudience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AuthenticationConfigurationAudience = (string) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AuthenticationConfigurationAudience, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationSmartProxyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AuthenticationConfigurationSmartProxyEnabled = (bool?) content.GetValueForProperty("AuthenticationConfigurationSmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).AuthenticationConfigurationSmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CorConfigurationOrigin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationOrigin = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationOrigin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationOrigin, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationHeader = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationHeader",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationHeader, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationMethod = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationMethod",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationMethod, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationMaxAge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationMaxAge = (int?) content.GetValueForProperty("CorConfigurationMaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationMaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CorConfigurationAllowCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationAllowCredentials = (bool?) content.GetValueForProperty("CorConfigurationAllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).CorConfigurationAllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExportConfigurationStorageAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ExportConfigurationStorageAccountName = (string) content.GetValueForProperty("ExportConfigurationStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ExportConfigurationStorageAccountName, global::System.Convert.ToString); + } + if (content.Contains("ResourceVersionPolicyConfigurationDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfigurationDefault = (string) content.GetValueForProperty("ResourceVersionPolicyConfigurationDefault",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfigurationDefault, global::System.Convert.ToString); + } + if (content.Contains("ResourceVersionPolicyConfigurationResourceTypeOverride")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfigurationResourceTypeOverride = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides) content.GetValueForProperty("ResourceVersionPolicyConfigurationResourceTypeOverride",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal)this).ResourceVersionPolicyConfigurationResourceTypeOverride, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfigurationResourceTypeOverridesTypeConverter.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.HealthcareApis.Models.IFhirServiceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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(); + } + } + /// Fhir Service properties. + [System.ComponentModel.TypeConverter(typeof(FhirServicePropertiesTypeConverter))] + public partial interface IFhirServiceProperties + + { + + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceProperties.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceProperties.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceProperties.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceProperties.TypeConverter.cs index 1e9edfd4c1d9..92c8254bc0c8 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceProperties.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IFhirServiceProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceProperties.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceProperties.cs similarity index 54% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceProperties.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceProperties.cs index 2fb20f16878d..1b64f10f503c 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceProperties.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceProperties.cs @@ -3,163 +3,163 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Fhir Service properties. public partial class FhirServiceProperties : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceProperties, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry[] _accessPolicy; + private System.Collections.Generic.List _accessPolicy; /// Fhir Service access policies. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry[] AccessPolicy { get => this._accessPolicy; set => this._accessPolicy = value; } + public System.Collections.Generic.List AccessPolicy { get => this._accessPolicy; set => this._accessPolicy = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration _acrConfiguration; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration _acrConfiguration; /// Fhir Service Azure container registry configuration. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration AcrConfiguration { get => (this._acrConfiguration = this._acrConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAcrConfiguration()); set => this._acrConfiguration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration AcrConfiguration { get => (this._acrConfiguration = this._acrConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAcrConfiguration()); set => this._acrConfiguration = value; } /// The list of the Azure container registry login servers. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string[] AcrConfigurationLoginServer { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfigurationInternal)AcrConfiguration).LoginServer; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfigurationInternal)AcrConfiguration).LoginServer = value ?? null /* arrayOf */; } + public System.Collections.Generic.List AcrConfigurationLoginServer { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfigurationInternal)AcrConfiguration).LoginServer; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfigurationInternal)AcrConfiguration).LoginServer = value ?? null /* arrayOf */; } /// The list of Open Container Initiative (OCI) artifacts. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfigurationInternal)AcrConfiguration).OciArtifact; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfigurationInternal)AcrConfiguration).OciArtifact = value ?? null /* arrayOf */; } + public System.Collections.Generic.List AcrConfigurationOciArtifact { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfigurationInternal)AcrConfiguration).OciArtifact; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfigurationInternal)AcrConfiguration).OciArtifact = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration _authenticationConfiguration; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration _authenticationConfiguration; /// Fhir Service authentication configuration. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration AuthenticationConfiguration { get => (this._authenticationConfiguration = this._authenticationConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAuthenticationConfiguration()); set => this._authenticationConfiguration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration AuthenticationConfiguration { get => (this._authenticationConfiguration = this._authenticationConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAuthenticationConfiguration()); set => this._authenticationConfiguration = value; } /// The audience url for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string AuthenticationConfigurationAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Audience; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Audience = value ?? null; } + public string AuthenticationConfigurationAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Audience; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Audience = value ?? null; } /// The authority url for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string AuthenticationConfigurationAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Authority = value ?? null; } + public string AuthenticationConfigurationAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).Authority = value ?? null; } /// If the SMART on FHIR proxy is enabled [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public bool? AuthenticationConfigurationSmartProxyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).SmartProxyEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).SmartProxyEnabled = value ?? default(bool); } + public bool? AuthenticationConfigurationSmartProxyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).SmartProxyEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfigurationInternal)AuthenticationConfiguration).SmartProxyEnabled = value ?? default(bool); } /// If credentials are allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public bool? CorConfigurationAllowCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)CorsConfiguration).AllowCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)CorsConfiguration).AllowCredentials = value ?? default(bool); } + public bool? CorConfigurationAllowCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)CorsConfiguration).AllowCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)CorsConfiguration).AllowCredentials = value ?? default(bool); } /// The headers to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string[] CorConfigurationHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)CorsConfiguration).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)CorsConfiguration).Header = value ?? null /* arrayOf */; } + public System.Collections.Generic.List CorConfigurationHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)CorsConfiguration).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)CorsConfiguration).Header = value ?? null /* arrayOf */; } /// The max age to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public int? CorConfigurationMaxAge { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)CorsConfiguration).MaxAge; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)CorsConfiguration).MaxAge = value ?? default(int); } + public int? CorConfigurationMaxAge { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)CorsConfiguration).MaxAge; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)CorsConfiguration).MaxAge = value ?? default(int); } /// The methods to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string[] CorConfigurationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)CorsConfiguration).Method; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)CorsConfiguration).Method = value ?? null /* arrayOf */; } + public System.Collections.Generic.List CorConfigurationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)CorsConfiguration).Method; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)CorsConfiguration).Method = value ?? null /* arrayOf */; } /// The origins to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string[] CorConfigurationOrigin { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)CorsConfiguration).Origin; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfigurationInternal)CorsConfiguration).Origin = value ?? null /* arrayOf */; } + public System.Collections.Generic.List CorConfigurationOrigin { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)CorsConfiguration).Origin; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfigurationInternal)CorsConfiguration).Origin = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration _corsConfiguration; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration _corsConfiguration; /// Fhir Service Cors configuration. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration CorsConfiguration { get => (this._corsConfiguration = this._corsConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceCorsConfiguration()); set => this._corsConfiguration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration CorsConfiguration { get => (this._corsConfiguration = this._corsConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceCorsConfiguration()); set => this._corsConfiguration = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState? _eventState; + private string _eventState; /// Fhir Service event support status. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState? EventState { get => this._eventState; } + public string EventState { get => this._eventState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration _exportConfiguration; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration _exportConfiguration; /// Fhir Service export configuration. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration ExportConfiguration { get => (this._exportConfiguration = this._exportConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceExportConfiguration()); set => this._exportConfiguration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration ExportConfiguration { get => (this._exportConfiguration = this._exportConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceExportConfiguration()); set => this._exportConfiguration = value; } /// The name of the default export storage account. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string ExportConfigurationStorageAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfigurationInternal)ExportConfiguration).StorageAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfigurationInternal)ExportConfiguration).StorageAccountName = value ?? null; } + public string ExportConfigurationStorageAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfigurationInternal)ExportConfiguration).StorageAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfigurationInternal)ExportConfiguration).StorageAccountName = value ?? null; } /// Internal Acessors for AcrConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal.AcrConfiguration { get => (this._acrConfiguration = this._acrConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAcrConfiguration()); set { {_acrConfiguration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal.AcrConfiguration { get => (this._acrConfiguration = this._acrConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAcrConfiguration()); set { {_acrConfiguration = value;} } } /// Internal Acessors for AuthenticationConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal.AuthenticationConfiguration { get => (this._authenticationConfiguration = this._authenticationConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAuthenticationConfiguration()); set { {_authenticationConfiguration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal.AuthenticationConfiguration { get => (this._authenticationConfiguration = this._authenticationConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAuthenticationConfiguration()); set { {_authenticationConfiguration = value;} } } /// Internal Acessors for CorsConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal.CorsConfiguration { get => (this._corsConfiguration = this._corsConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceCorsConfiguration()); set { {_corsConfiguration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal.CorsConfiguration { get => (this._corsConfiguration = this._corsConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceCorsConfiguration()); set { {_corsConfiguration = value;} } } /// Internal Acessors for EventState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal.EventState { get => this._eventState; set { {_eventState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal.EventState { get => this._eventState; set { {_eventState = value;} } } /// Internal Acessors for ExportConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal.ExportConfiguration { get => (this._exportConfiguration = this._exportConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceExportConfiguration()); set { {_exportConfiguration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal.ExportConfiguration { get => (this._exportConfiguration = this._exportConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceExportConfiguration()); set { {_exportConfiguration = value;} } } /// Internal Acessors for PrivateEndpointConnection - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal.PrivateEndpointConnection { get => this._privateEndpointConnection; set { {_privateEndpointConnection = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal.PrivateEndpointConnection { get => this._privateEndpointConnection; set { {_privateEndpointConnection = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Internal Acessors for ResourceVersionPolicyConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePropertiesInternal.ResourceVersionPolicyConfiguration { get => (this._resourceVersionPolicyConfiguration = this._resourceVersionPolicyConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfiguration()); set { {_resourceVersionPolicyConfiguration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServicePropertiesInternal.ResourceVersionPolicyConfiguration { get => (this._resourceVersionPolicyConfiguration = this._resourceVersionPolicyConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfiguration()); set { {_resourceVersionPolicyConfiguration = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] _privateEndpointConnection; + private System.Collections.Generic.List _privateEndpointConnection; /// The list of private endpoint connections that are set up for this resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get => this._privateEndpointConnection; } + public System.Collections.Generic.List PrivateEndpointConnection { get => this._privateEndpointConnection; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? _publicNetworkAccess; + private string _publicNetworkAccess; /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } + public string PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration _resourceVersionPolicyConfiguration; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration _resourceVersionPolicyConfiguration; /// Determines tracking of history for resources. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration ResourceVersionPolicyConfiguration { get => (this._resourceVersionPolicyConfiguration = this._resourceVersionPolicyConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfiguration()); set => this._resourceVersionPolicyConfiguration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration ResourceVersionPolicyConfiguration { get => (this._resourceVersionPolicyConfiguration = this._resourceVersionPolicyConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfiguration()); set => this._resourceVersionPolicyConfiguration = value; } /// The default value for tracking history across all resources. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy? ResourceVersionPolicyConfigurationDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationInternal)ResourceVersionPolicyConfiguration).Default; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationInternal)ResourceVersionPolicyConfiguration).Default = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy)""); } + public string ResourceVersionPolicyConfigurationDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationInternal)ResourceVersionPolicyConfiguration).Default; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationInternal)ResourceVersionPolicyConfiguration).Default = value ?? null; } /// A list of FHIR Resources and their version policy overrides. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceVersionPolicyConfigurationResourceTypeOverride { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationInternal)ResourceVersionPolicyConfiguration).ResourceTypeOverride; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationInternal)ResourceVersionPolicyConfiguration).ResourceTypeOverride = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceVersionPolicyConfigurationResourceTypeOverride { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationInternal)ResourceVersionPolicyConfiguration).ResourceTypeOverride; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationInternal)ResourceVersionPolicyConfiguration).ResourceTypeOverride = value ?? null /* model class */; } /// Creates an new instance. public FhirServiceProperties() @@ -175,30 +175,42 @@ public partial interface IFhirServiceProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fhir Service access policies.", SerializedName = @"accessPolicies", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry[] AccessPolicy { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry) })] + System.Collections.Generic.List AccessPolicy { get; set; } /// The list of the Azure container registry login servers. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of the Azure container registry login servers.", SerializedName = @"loginServers", PossibleTypes = new [] { typeof(string) })] - string[] AcrConfigurationLoginServer { get; set; } + System.Collections.Generic.List AcrConfigurationLoginServer { get; set; } /// The list of Open Container Initiative (OCI) artifacts. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Open Container Initiative (OCI) artifacts.", SerializedName = @"ociArtifacts", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry) })] + System.Collections.Generic.List AcrConfigurationOciArtifact { get; set; } /// The audience url for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The audience url for the service", SerializedName = @"audience", PossibleTypes = new [] { typeof(string) })] @@ -207,6 +219,9 @@ public partial interface IFhirServiceProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The authority url for the service", SerializedName = @"authority", PossibleTypes = new [] { typeof(string) })] @@ -215,6 +230,9 @@ public partial interface IFhirServiceProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If the SMART on FHIR proxy is enabled", SerializedName = @"smartProxyEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -223,6 +241,9 @@ public partial interface IFhirServiceProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If credentials are allowed via CORS.", SerializedName = @"allowCredentials", PossibleTypes = new [] { typeof(bool) })] @@ -231,14 +252,20 @@ public partial interface IFhirServiceProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The headers to be allowed via CORS.", SerializedName = @"headers", PossibleTypes = new [] { typeof(string) })] - string[] CorConfigurationHeader { get; set; } + System.Collections.Generic.List CorConfigurationHeader { get; set; } /// The max age to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The max age to be allowed via CORS.", SerializedName = @"maxAge", PossibleTypes = new [] { typeof(int) })] @@ -247,30 +274,43 @@ public partial interface IFhirServiceProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The methods to be allowed via CORS.", SerializedName = @"methods", PossibleTypes = new [] { typeof(string) })] - string[] CorConfigurationMethod { get; set; } + System.Collections.Generic.List CorConfigurationMethod { get; set; } /// The origins to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The origins to be allowed via CORS.", SerializedName = @"origins", PossibleTypes = new [] { typeof(string) })] - string[] CorConfigurationOrigin { get; set; } + System.Collections.Generic.List CorConfigurationOrigin { get; set; } /// Fhir Service event support status. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Fhir Service event support status.", SerializedName = @"eventState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState? EventState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Disabled", "Enabled", "Updating")] + string EventState { get; } /// The name of the default export storage account. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the default export storage account.", SerializedName = @"storageAccountName", PossibleTypes = new [] { typeof(string) })] @@ -279,44 +319,62 @@ public partial interface IFhirServiceProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The list of private endpoint connections that are set up for this resource.", SerializedName = @"privateEndpointConnections", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection) })] + System.Collections.Generic.List PrivateEndpointConnection { get; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } /// The default value for tracking history across all resources. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The default value for tracking history across all resources.", SerializedName = @"default", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy? ResourceVersionPolicyConfigurationDefault { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("no-version", "versioned", "versioned-update")] + string ResourceVersionPolicyConfigurationDefault { get; set; } /// A list of FHIR Resources and their version policy overrides. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of FHIR Resources and their version policy overrides.", SerializedName = @"resourceTypeOverrides", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceVersionPolicyConfigurationResourceTypeOverride { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceVersionPolicyConfigurationResourceTypeOverride { get; set; } } /// Fhir Service properties. @@ -324,15 +382,15 @@ internal partial interface IFhirServicePropertiesInternal { /// Fhir Service access policies. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry[] AccessPolicy { get; set; } + System.Collections.Generic.List AccessPolicy { get; set; } /// Fhir Service Azure container registry configuration. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAcrConfiguration AcrConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAcrConfiguration AcrConfiguration { get; set; } /// The list of the Azure container registry login servers. - string[] AcrConfigurationLoginServer { get; set; } + System.Collections.Generic.List AcrConfigurationLoginServer { get; set; } /// The list of Open Container Initiative (OCI) artifacts. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get; set; } + System.Collections.Generic.List AcrConfigurationOciArtifact { get; set; } /// Fhir Service authentication configuration. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAuthenticationConfiguration AuthenticationConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAuthenticationConfiguration AuthenticationConfiguration { get; set; } /// The audience url for the service string AuthenticationConfigurationAudience { get; set; } /// The authority url for the service @@ -342,35 +400,39 @@ internal partial interface IFhirServicePropertiesInternal /// If credentials are allowed via CORS. bool? CorConfigurationAllowCredentials { get; set; } /// The headers to be allowed via CORS. - string[] CorConfigurationHeader { get; set; } + System.Collections.Generic.List CorConfigurationHeader { get; set; } /// The max age to be allowed via CORS. int? CorConfigurationMaxAge { get; set; } /// The methods to be allowed via CORS. - string[] CorConfigurationMethod { get; set; } + System.Collections.Generic.List CorConfigurationMethod { get; set; } /// The origins to be allowed via CORS. - string[] CorConfigurationOrigin { get; set; } + System.Collections.Generic.List CorConfigurationOrigin { get; set; } /// Fhir Service Cors configuration. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceCorsConfiguration CorsConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCorsConfiguration CorsConfiguration { get; set; } /// Fhir Service event support status. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState? EventState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Disabled", "Enabled", "Updating")] + string EventState { get; set; } /// Fhir Service export configuration. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceExportConfiguration ExportConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceExportConfiguration ExportConfiguration { get; set; } /// The name of the default export storage account. string ExportConfigurationStorageAccountName { get; set; } /// The list of private endpoint connections that are set up for this resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + System.Collections.Generic.List PrivateEndpointConnection { get; set; } /// The provisioning state. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; set; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } /// Determines tracking of history for resources. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration ResourceVersionPolicyConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration ResourceVersionPolicyConfiguration { get; set; } /// The default value for tracking history across all resources. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy? ResourceVersionPolicyConfigurationDefault { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("no-version", "versioned", "versioned-update")] + string ResourceVersionPolicyConfigurationDefault { get; set; } /// A list of FHIR Resources and their version policy overrides. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceVersionPolicyConfigurationResourceTypeOverride { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceVersionPolicyConfigurationResourceTypeOverride { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceProperties.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceProperties.json.cs similarity index 84% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceProperties.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceProperties.json.cs index 6380e1a9844c..2d9bfa8a54bc 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/FhirServiceProperties.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/FhirServiceProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -65,27 +65,27 @@ internal FhirServiceProperties(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis { return; } - {_acrConfiguration = If( json?.PropertyT("acrConfiguration"), out var __jsonAcrConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAcrConfiguration.FromJson(__jsonAcrConfiguration) : AcrConfiguration;} - {_authenticationConfiguration = If( json?.PropertyT("authenticationConfiguration"), out var __jsonAuthenticationConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAuthenticationConfiguration.FromJson(__jsonAuthenticationConfiguration) : AuthenticationConfiguration;} - {_corsConfiguration = If( json?.PropertyT("corsConfiguration"), out var __jsonCorsConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceCorsConfiguration.FromJson(__jsonCorsConfiguration) : CorsConfiguration;} - {_exportConfiguration = If( json?.PropertyT("exportConfiguration"), out var __jsonExportConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceExportConfiguration.FromJson(__jsonExportConfiguration) : ExportConfiguration;} - {_resourceVersionPolicyConfiguration = If( json?.PropertyT("resourceVersionPolicyConfiguration"), out var __jsonResourceVersionPolicyConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfiguration.FromJson(__jsonResourceVersionPolicyConfiguration) : ResourceVersionPolicyConfiguration;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_accessPolicy = If( json?.PropertyT("accessPolicies"), out var __jsonAccessPolicies) ? If( __jsonAccessPolicies as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServiceAccessPolicyEntry.FromJson(__u) )) ))() : null : AccessPolicy;} - {_privateEndpointConnection = If( json?.PropertyT("privateEndpointConnections"), out var __jsonPrivateEndpointConnections) ? If( __jsonPrivateEndpointConnections as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api10.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnection.FromJson(__p) )) ))() : null : PrivateEndpointConnection;} - {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)PublicNetworkAccess;} - {_eventState = If( json?.PropertyT("eventState"), out var __jsonEventState) ? (string)__jsonEventState : (string)EventState;} + {_acrConfiguration = If( json?.PropertyT("acrConfiguration"), out var __jsonAcrConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAcrConfiguration.FromJson(__jsonAcrConfiguration) : _acrConfiguration;} + {_authenticationConfiguration = If( json?.PropertyT("authenticationConfiguration"), out var __jsonAuthenticationConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAuthenticationConfiguration.FromJson(__jsonAuthenticationConfiguration) : _authenticationConfiguration;} + {_corsConfiguration = If( json?.PropertyT("corsConfiguration"), out var __jsonCorsConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceCorsConfiguration.FromJson(__jsonCorsConfiguration) : _corsConfiguration;} + {_exportConfiguration = If( json?.PropertyT("exportConfiguration"), out var __jsonExportConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceExportConfiguration.FromJson(__jsonExportConfiguration) : _exportConfiguration;} + {_resourceVersionPolicyConfiguration = If( json?.PropertyT("resourceVersionPolicyConfiguration"), out var __jsonResourceVersionPolicyConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfiguration.FromJson(__jsonResourceVersionPolicyConfiguration) : _resourceVersionPolicyConfiguration;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_accessPolicy = If( json?.PropertyT("accessPolicies"), out var __jsonAccessPolicies) ? If( __jsonAccessPolicies as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IFhirServiceAccessPolicyEntry) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirServiceAccessPolicyEntry.FromJson(__u) )) ))() : null : _accessPolicy;} + {_privateEndpointConnection = If( json?.PropertyT("privateEndpointConnections"), out var __jsonPrivateEndpointConnections) ? If( __jsonPrivateEndpointConnections as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnection.FromJson(__p) )) ))() : null : _privateEndpointConnection;} + {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)_publicNetworkAccess;} + {_eventState = If( json?.PropertyT("eventState"), out var __jsonEventState) ? (string)__jsonEventState : (string)_eventState;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new FhirServiceProperties(json) : null; } @@ -114,7 +114,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T AddIf( null != this._corsConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._corsConfiguration.ToJson(null,serializationMode) : null, "corsConfiguration" ,container.Add ); AddIf( null != this._exportConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._exportConfiguration.ToJson(null,serializationMode) : null, "exportConfiguration" ,container.Add ); AddIf( null != this._resourceVersionPolicyConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._resourceVersionPolicyConfiguration.ToJson(null,serializationMode) : null, "resourceVersionPolicyConfiguration" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } @@ -127,7 +127,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T } container.Add("accessPolicies",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { if (null != this._privateEndpointConnection) { @@ -140,7 +140,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T } } AddIf( null != (((object)this._publicNetworkAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._publicNetworkAccess.ToString()) : null, "publicNetworkAccess" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._eventState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._eventState.ToString()) : null, "eventState" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/HealthcareApisIdentity.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/HealthcareApisIdentity.PowerShell.cs index c07ab727857a..b8b9debbe7da 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/HealthcareApisIdentity.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/HealthcareApisIdentity.PowerShell.cs @@ -53,6 +53,14 @@ public partial class HealthcareApisIdentity 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 . @@ -228,6 +236,18 @@ internal HealthcareApisIdentity(global::System.Management.Automation.PSObject co /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } [System.ComponentModel.TypeConverter(typeof(HealthcareApisIdentityTypeConverter))] public partial interface IHealthcareApisIdentity diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/HealthcareApisIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/HealthcareApisIdentity.cs index 546db329f38e..128f38b72cd8 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/HealthcareApisIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/HealthcareApisIdentity.cs @@ -116,6 +116,9 @@ public partial interface IHealthcareApisIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of DICOM Service resource.", SerializedName = @"dicomServiceName", PossibleTypes = new [] { typeof(string) })] @@ -124,6 +127,9 @@ public partial interface IHealthcareApisIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of IoT Connector FHIR destination resource.", SerializedName = @"fhirDestinationName", PossibleTypes = new [] { typeof(string) })] @@ -132,6 +138,9 @@ public partial interface IHealthcareApisIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of FHIR Service resource.", SerializedName = @"fhirServiceName", PossibleTypes = new [] { typeof(string) })] @@ -140,6 +149,9 @@ public partial interface IHealthcareApisIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the private link resource group.", SerializedName = @"groupName", PossibleTypes = new [] { typeof(string) })] @@ -148,6 +160,9 @@ public partial interface IHealthcareApisIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -156,6 +171,9 @@ public partial interface IHealthcareApisIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of IoT Connector resource.", SerializedName = @"iotConnectorName", PossibleTypes = new [] { typeof(string) })] @@ -164,6 +182,9 @@ public partial interface IHealthcareApisIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The location of the operation.", SerializedName = @"locationName", PossibleTypes = new [] { typeof(string) })] @@ -172,6 +193,9 @@ public partial interface IHealthcareApisIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ID of the operation result to get.", SerializedName = @"operationResultId", PossibleTypes = new [] { typeof(string) })] @@ -180,6 +204,9 @@ public partial interface IHealthcareApisIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the private endpoint connection associated with the Azure resource", SerializedName = @"privateEndpointConnectionName", PossibleTypes = new [] { typeof(string) })] @@ -188,6 +215,9 @@ public partial interface IHealthcareApisIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the resource group that contains the service instance.", SerializedName = @"resourceGroupName", PossibleTypes = new [] { typeof(string) })] @@ -196,6 +226,9 @@ public partial interface IHealthcareApisIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the service instance.", SerializedName = @"resourceName", PossibleTypes = new [] { typeof(string) })] @@ -204,6 +237,9 @@ public partial interface IHealthcareApisIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The subscription identifier.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -212,6 +248,9 @@ public partial interface IHealthcareApisIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of workspace resource.", SerializedName = @"workspaceName", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/HealthcareApisIdentity.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/HealthcareApisIdentity.json.cs index 0048894903fb..403d98c8484c 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/HealthcareApisIdentity.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/HealthcareApisIdentity.json.cs @@ -76,19 +76,19 @@ internal HealthcareApisIdentity(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApi { return; } - {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} - {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} - {_resourceName = If( json?.PropertyT("resourceName"), out var __jsonResourceName) ? (string)__jsonResourceName : (string)ResourceName;} - {_privateEndpointConnectionName = If( json?.PropertyT("privateEndpointConnectionName"), out var __jsonPrivateEndpointConnectionName) ? (string)__jsonPrivateEndpointConnectionName : (string)PrivateEndpointConnectionName;} - {_groupName = If( json?.PropertyT("groupName"), out var __jsonGroupName) ? (string)__jsonGroupName : (string)GroupName;} - {_workspaceName = If( json?.PropertyT("workspaceName"), out var __jsonWorkspaceName) ? (string)__jsonWorkspaceName : (string)WorkspaceName;} - {_dicomServiceName = If( json?.PropertyT("dicomServiceName"), out var __jsonDicomServiceName) ? (string)__jsonDicomServiceName : (string)DicomServiceName;} - {_iotConnectorName = If( json?.PropertyT("iotConnectorName"), out var __jsonIotConnectorName) ? (string)__jsonIotConnectorName : (string)IotConnectorName;} - {_fhirDestinationName = If( json?.PropertyT("fhirDestinationName"), out var __jsonFhirDestinationName) ? (string)__jsonFhirDestinationName : (string)FhirDestinationName;} - {_fhirServiceName = If( json?.PropertyT("fhirServiceName"), out var __jsonFhirServiceName) ? (string)__jsonFhirServiceName : (string)FhirServiceName;} - {_locationName = If( json?.PropertyT("locationName"), out var __jsonLocationName) ? (string)__jsonLocationName : (string)LocationName;} - {_operationResultId = If( json?.PropertyT("operationResultId"), out var __jsonOperationResultId) ? (string)__jsonOperationResultId : (string)OperationResultId;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)_subscriptionId;} + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)_resourceGroupName;} + {_resourceName = If( json?.PropertyT("resourceName"), out var __jsonResourceName) ? (string)__jsonResourceName : (string)_resourceName;} + {_privateEndpointConnectionName = If( json?.PropertyT("privateEndpointConnectionName"), out var __jsonPrivateEndpointConnectionName) ? (string)__jsonPrivateEndpointConnectionName : (string)_privateEndpointConnectionName;} + {_groupName = If( json?.PropertyT("groupName"), out var __jsonGroupName) ? (string)__jsonGroupName : (string)_groupName;} + {_workspaceName = If( json?.PropertyT("workspaceName"), out var __jsonWorkspaceName) ? (string)__jsonWorkspaceName : (string)_workspaceName;} + {_dicomServiceName = If( json?.PropertyT("dicomServiceName"), out var __jsonDicomServiceName) ? (string)__jsonDicomServiceName : (string)_dicomServiceName;} + {_iotConnectorName = If( json?.PropertyT("iotConnectorName"), out var __jsonIotConnectorName) ? (string)__jsonIotConnectorName : (string)_iotConnectorName;} + {_fhirDestinationName = If( json?.PropertyT("fhirDestinationName"), out var __jsonFhirDestinationName) ? (string)__jsonFhirDestinationName : (string)_fhirDestinationName;} + {_fhirServiceName = If( json?.PropertyT("fhirServiceName"), out var __jsonFhirServiceName) ? (string)__jsonFhirServiceName : (string)_fhirServiceName;} + {_locationName = If( json?.PropertyT("locationName"), out var __jsonLocationName) ? (string)__jsonLocationName : (string)_locationName;} + {_operationResultId = If( json?.PropertyT("operationResultId"), out var __jsonOperationResultId) ? (string)__jsonOperationResultId : (string)_operationResultId;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/InternalErrorDetails.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/InternalErrorDetails.PowerShell.cs similarity index 71% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/InternalErrorDetails.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/InternalErrorDetails.PowerShell.cs index feb421306cb5..86beb14191da 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/InternalErrorDetails.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/InternalErrorDetails.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class InternalErrorDetails partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new InternalErrorDetails(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.HealthcareApis.Models.Api20211101.IInternalErrorDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new InternalErrorDetails(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,21 +111,21 @@ internal InternalErrorDetails(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)this).Target, 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. @@ -134,15 +140,15 @@ internal InternalErrorDetails(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal)this).Target, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,6 +157,18 @@ internal InternalErrorDetails(global::System.Management.Automation.PSObject cont /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Error details. [System.ComponentModel.TypeConverter(typeof(InternalErrorDetailsTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/InternalErrorDetails.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/InternalErrorDetails.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/InternalErrorDetails.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/InternalErrorDetails.TypeConverter.cs index f6646590ef8e..47da60e6e470 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/InternalErrorDetails.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/InternalErrorDetails.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IInternalErrorDetails ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/InternalErrorDetails.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/InternalErrorDetails.cs similarity index 87% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/InternalErrorDetails.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/InternalErrorDetails.cs index 0bc294b5299b..333088552efd 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/InternalErrorDetails.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/InternalErrorDetails.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Error details. public partial class InternalErrorDetails : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal { /// Backing field for property. @@ -28,13 +28,13 @@ public partial class InternalErrorDetails : public string Message { get => this._message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal.Code { get => this._code; set { {_code = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal.Code { get => this._code; set { {_code = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal.Message { get => this._message; set { {_message = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal.Message { get => this._message; set { {_message = value;} } } /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetailsInternal.Target { get => this._target; set { {_target = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetailsInternal.Target { get => this._target; set { {_target = value;} } } /// Backing field for property. private string _target; @@ -57,6 +57,9 @@ public partial interface IInternalErrorDetails : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -65,6 +68,9 @@ public partial interface IInternalErrorDetails : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -73,6 +79,9 @@ public partial interface IInternalErrorDetails : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The target of the particular error.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/InternalErrorDetails.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/InternalErrorDetails.json.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/InternalErrorDetails.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/InternalErrorDetails.json.cs index b9d15f7776c5..58f0fb84183f 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/InternalErrorDetails.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/InternalErrorDetails.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class InternalErrorDetails partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IInternalErrorDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IInternalErrorDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new InternalErrorDetails(json) : null; } @@ -77,9 +77,9 @@ internal InternalErrorDetails(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis. { 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;} + {_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;} AfterFromJson(json); } @@ -102,15 +102,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnector.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnector.PowerShell.cs new file mode 100644 index 000000000000..efd52604f9eb --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnector.PowerShell.cs @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + + /// IoT Connector definition. + [System.ComponentModel.TypeConverter(typeof(IotConnectorTypeConverter))] + public partial class IotConnector + { + + /// + /// 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.HealthcareApis.Models.IIotConnector DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IotConnector(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.HealthcareApis.Models.IIotConnector DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IotConnector(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.HealthcareApis.Models.IIotConnector FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IotConnector(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.HealthcareApis.Models.IIotConnectorInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnectorPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1TypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IngestionEndpointConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).IngestionEndpointConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration) content.GetValueForProperty("IngestionEndpointConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).IngestionEndpointConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotEventHubIngestionEndpointConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DeviceMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).DeviceMapping = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties) content.GetValueForProperty("DeviceMapping",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).DeviceMapping, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IngestionEndpointConfigurationEventHubName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).IngestionEndpointConfigurationEventHubName = (string) content.GetValueForProperty("IngestionEndpointConfigurationEventHubName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).IngestionEndpointConfigurationEventHubName, global::System.Convert.ToString); + } + if (content.Contains("IngestionEndpointConfigurationConsumerGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).IngestionEndpointConfigurationConsumerGroup = (string) content.GetValueForProperty("IngestionEndpointConfigurationConsumerGroup",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).IngestionEndpointConfigurationConsumerGroup, global::System.Convert.ToString); + } + if (content.Contains("IngestionEndpointConfigurationFullyQualifiedEventHubNamespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace = (string) content.GetValueForProperty("IngestionEndpointConfigurationFullyQualifiedEventHubNamespace",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace, global::System.Convert.ToString); + } + if (content.Contains("DeviceMappingContent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).DeviceMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) content.GetValueForProperty("DeviceMappingContent",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).DeviceMappingContent, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesContentTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IotConnector(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.HealthcareApis.Models.IIotConnectorInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnectorPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1TypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IngestionEndpointConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).IngestionEndpointConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration) content.GetValueForProperty("IngestionEndpointConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).IngestionEndpointConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotEventHubIngestionEndpointConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DeviceMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).DeviceMapping = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties) content.GetValueForProperty("DeviceMapping",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).DeviceMapping, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IngestionEndpointConfigurationEventHubName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).IngestionEndpointConfigurationEventHubName = (string) content.GetValueForProperty("IngestionEndpointConfigurationEventHubName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).IngestionEndpointConfigurationEventHubName, global::System.Convert.ToString); + } + if (content.Contains("IngestionEndpointConfigurationConsumerGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).IngestionEndpointConfigurationConsumerGroup = (string) content.GetValueForProperty("IngestionEndpointConfigurationConsumerGroup",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).IngestionEndpointConfigurationConsumerGroup, global::System.Convert.ToString); + } + if (content.Contains("IngestionEndpointConfigurationFullyQualifiedEventHubNamespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace = (string) content.GetValueForProperty("IngestionEndpointConfigurationFullyQualifiedEventHubNamespace",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace, global::System.Convert.ToString); + } + if (content.Contains("DeviceMappingContent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).DeviceMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) content.GetValueForProperty("DeviceMappingContent",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal)this).DeviceMappingContent, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesContentTypeConverter.ConvertFrom); + } + 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.HealthcareApis.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(); + } + } + /// IoT Connector definition. + [System.ComponentModel.TypeConverter(typeof(IotConnectorTypeConverter))] + public partial interface IIotConnector + + { + + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnector.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnector.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnector.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnector.TypeConverter.cs index de521fa6f443..6c07d65a5bcd 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnector.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnector.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IIotConnector ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnector.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnector.cs similarity index 58% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnector.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnector.cs index e072730091ca..663398210d11 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnector.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnector.cs @@ -3,72 +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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// IoT Connector definition. public partial class IotConnector : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentity(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity(); /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResource __taggedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.TaggedResource(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResource __taggedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.TaggedResource(); /// The mapping. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent DeviceMappingContent { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)Property).DeviceMappingContent; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)Property).DeviceMappingContent = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent DeviceMappingContent { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)Property).DeviceMappingContent; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)Property).DeviceMappingContent = value ?? null /* model class */; } /// /// An etag associated with the resource, used for optimistic concurrency when editing it. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Etag = value ?? null; } /// The resource identifier. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Id; } /// /// Setting indicating whether the service has a managed identity associated with it. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity = value ?? null /* model class */; } /// /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; } + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; } /// /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; } + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; } /// /// Type of identity being specified, currently SystemAssigned and None are allowed. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType)""); } + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType = value ?? null; } /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM @@ -77,75 +77,96 @@ public partial class IotConnector : /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity = value ?? null /* model class */; } /// Consumer group of the event hub to connected to. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string IngestionEndpointConfigurationConsumerGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)Property).IngestionEndpointConfigurationConsumerGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)Property).IngestionEndpointConfigurationConsumerGroup = value ?? null; } + public string IngestionEndpointConfigurationConsumerGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)Property).IngestionEndpointConfigurationConsumerGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)Property).IngestionEndpointConfigurationConsumerGroup = value ?? null; } /// Event Hub name to connect to. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string IngestionEndpointConfigurationEventHubName { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)Property).IngestionEndpointConfigurationEventHubName; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)Property).IngestionEndpointConfigurationEventHubName = value ?? null; } + public string IngestionEndpointConfigurationEventHubName { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)Property).IngestionEndpointConfigurationEventHubName; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)Property).IngestionEndpointConfigurationEventHubName = value ?? null; } /// Fully qualified namespace of the Event Hub to connect to. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string IngestionEndpointConfigurationFullyQualifiedEventHubNamespace { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)Property).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)Property).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace = value ?? null; } + public string IngestionEndpointConfigurationFullyQualifiedEventHubNamespace { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)Property).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)Property).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace = value ?? null; } /// The resource location. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.FormatTable(Index = 0)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)__taggedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)__taggedResource).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)__taggedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)__taggedResource).Location = value ?? null; } /// Internal Acessors for DeviceMapping - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal.DeviceMapping { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)Property).DeviceMapping; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)Property).DeviceMapping = value; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal.DeviceMapping { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)Property).DeviceMapping; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)Property).DeviceMapping = value ?? null /* model class */; } /// Internal Acessors for IngestionEndpointConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal.IngestionEndpointConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)Property).IngestionEndpointConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)Property).IngestionEndpointConfiguration = value; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal.IngestionEndpointConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)Property).IngestionEndpointConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)Property).IngestionEndpointConfiguration = value ?? null /* model class */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnectorProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnectorProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)Property).ProvisioningState = value ?? null; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Type = value ?? null; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity = value ?? null /* model class */; } /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId = value ?? null; } /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId = value ?? null; } /// The resource name. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.FormatTable(Index = 1)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorProperties _property; /// IoT Connector configuration. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnectorProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnectorProperties()); set => this._property = value; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)Property).ProvisioningState; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] @@ -153,52 +174,52 @@ public partial class IotConnector : 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); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData _systemData; /// Metadata pertaining to creation and last modification of the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)__taggedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)__taggedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)__taggedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)__taggedResource).Tag = value ?? null /* model class */; } /// The resource type. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Type; } /// Creates an new instance. public IotConnector() @@ -223,21 +244,27 @@ public IotConnector() /// IoT Connector definition. public partial interface IIotConnector : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResource, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResource, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity { /// The mapping. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The mapping.", SerializedName = @"content", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent DeviceMappingContent { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent DeviceMappingContent { get; set; } /// Consumer group of the event hub to connected to. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Consumer group of the event hub to connected to.", SerializedName = @"consumerGroup", PossibleTypes = new [] { typeof(string) })] @@ -246,6 +273,9 @@ public partial interface IIotConnector : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Event Hub name to connect to.", SerializedName = @"eventHubName", PossibleTypes = new [] { typeof(string) })] @@ -254,6 +284,9 @@ public partial interface IIotConnector : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified namespace of the Event Hub to connect to.", SerializedName = @"fullyQualifiedEventHubNamespace", PossibleTypes = new [] { typeof(string) })] @@ -262,71 +295,95 @@ public partial interface IIotConnector : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } + global::System.DateTime? SystemDataCreatedAt { get; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } + string SystemDataCreatedBy { get; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } + global::System.DateTime? SystemDataLastModifiedAt { get; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } + string SystemDataLastModifiedBy { get; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } } /// IoT Connector definition. internal partial interface IIotConnectorInternal : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResourceInternal, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal { /// Device Mappings. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties DeviceMapping { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties DeviceMapping { get; set; } /// The mapping. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent DeviceMappingContent { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent DeviceMappingContent { get; set; } /// Source configuration. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration IngestionEndpointConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration IngestionEndpointConfiguration { get; set; } /// Consumer group of the event hub to connected to. string IngestionEndpointConfigurationConsumerGroup { get; set; } /// Event Hub name to connect to. @@ -334,23 +391,26 @@ internal partial interface IIotConnectorInternal : /// Fully qualified namespace of the Event Hub to connect to. string IngestionEndpointConfigurationFullyQualifiedEventHubNamespace { get; set; } /// IoT Connector configuration. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorProperties Property { get; set; } /// The provisioning state. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; set; } /// Metadata pertaining to creation and last modification of the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData SystemData { get; set; } /// The timestamp of resource creation (UTC). global::System.DateTime? SystemDataCreatedAt { get; set; } /// The identity that created the resource. string SystemDataCreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// The identity that last modified the resource. string SystemDataLastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnector.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnector.json.cs similarity index 92% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnector.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnector.json.cs index 38726d0c434c..05717cefbb6c 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnector.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnector.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class IotConnector partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new IotConnector(json) : null; } @@ -77,10 +77,10 @@ internal IotConnector(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime. { return; } - __taggedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.TaggedResource(json); - __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentity(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnectorProperties.FromJson(__jsonProperties) : Property;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData.FromJson(__jsonSystemData) : SystemData;} + __taggedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.TaggedResource(json); + __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnectorProperties.FromJson(__jsonProperties) : _property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} AfterFromJson(json); } @@ -106,7 +106,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T __taggedResource?.ToJson(container, serializationMode); __serviceManagedIdentity?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorCollection.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorCollection.PowerShell.cs similarity index 69% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorCollection.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorCollection.PowerShell.cs index 997f8da409c9..a0b1621e9236 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorCollection.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorCollection.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class IotConnectorCollection partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new IotConnectorCollection(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.HealthcareApis.Models.Api20211101.IIotConnectorCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new IotConnectorCollection(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,17 +111,17 @@ internal IotConnectorCollection(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorCollectionInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollectionInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnectorTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnectorTypeConverter.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. @@ -130,11 +136,11 @@ internal IotConnectorCollection(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorCollectionInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollectionInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnectorTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnectorTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -143,6 +149,18 @@ internal IotConnectorCollection(global::System.Management.Automation.PSObject co /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 collection of IoT Connectors. [System.ComponentModel.TypeConverter(typeof(IotConnectorCollectionTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorCollection.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorCollection.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorCollection.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorCollection.TypeConverter.cs index f9c26a847272..af45cc128198 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorCollection.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorCollection.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IIotConnectorCollection ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollection ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorCollection).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollection).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorCollection.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorCollection.cs similarity index 77% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorCollection.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorCollection.cs index bc066066c1cb..3bb2afe4602a 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorCollection.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorCollection.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// A collection of IoT Connectors. public partial class IotConnectorCollection : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorCollection, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorCollectionInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollection, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollectionInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class IotConnectorCollection : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector[] _value; + private System.Collections.Generic.List _value; /// The list of IoT Connectors. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public IotConnectorCollection() @@ -41,6 +41,9 @@ public partial interface IIotConnectorCollection : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link used to get the next page of IoT Connectors.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IIotConnectorCollection : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of IoT Connectors.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector) })] + System.Collections.Generic.List Value { get; set; } } /// A collection of IoT Connectors. @@ -62,7 +68,7 @@ internal partial interface IIotConnectorCollectionInternal /// The link used to get the next page of IoT Connectors. string NextLink { get; set; } /// The list of IoT Connectors. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorCollection.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorCollection.json.cs similarity index 91% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorCollection.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorCollection.json.cs index b5768a201df8..acda15dfdbcf 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorCollection.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorCollection.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class IotConnectorCollection partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorCollection. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollection. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorCollection. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollection. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new IotConnectorCollection(json) : null; } @@ -77,8 +77,8 @@ internal IotConnectorCollection(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApi { return; } - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IIotConnector) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnector.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.HealthcareApis.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.HealthcareApis.Models.IIotConnector) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnector.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorPatchResource.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorPatchResource.PowerShell.cs similarity index 59% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorPatchResource.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorPatchResource.PowerShell.cs index 4254f9ce6387..f3d00574818a 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorPatchResource.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorPatchResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class IotConnectorPatchResource partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPatchResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPatchResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new IotConnectorPatchResource(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.HealthcareApis.Models.Api20211101.IIotConnectorPatchResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPatchResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new IotConnectorPatchResource(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPatchResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPatchResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,33 +111,33 @@ internal IotConnectorPatchResource(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType, global::System.Convert.ToString); } if (content.Contains("IdentityPrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); } if (content.Contains("IdentityTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("Identity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGeneratedTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1TypeConverter.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. @@ -146,27 +152,27 @@ internal IotConnectorPatchResource(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType, global::System.Convert.ToString); } if (content.Contains("IdentityPrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); } if (content.Contains("IdentityTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("Identity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGeneratedTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1TypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -175,6 +181,18 @@ internal IotConnectorPatchResource(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Iot Connector patch properties [System.ComponentModel.TypeConverter(typeof(IotConnectorPatchResourceTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorPatchResource.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorPatchResource.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorPatchResource.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorPatchResource.TypeConverter.cs index ed1040a0726b..5e35977656e6 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorPatchResource.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorPatchResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IIotConnectorPatchResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPatchResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPatchResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPatchResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorPatchResource.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorPatchResource.cs similarity index 60% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorPatchResource.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorPatchResource.cs index 1c6d38fec7ed..114ed9a7542b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorPatchResource.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorPatchResource.cs @@ -3,51 +3,51 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Iot Connector patch properties public partial class IotConnectorPatchResource : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPatchResource, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPatchResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPatchResource, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPatchResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1 __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTags1(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1 __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTags1(); /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentity(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity(); /// /// Setting indicating whether the service has a managed identity associated with it. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity = value ?? null /* model class */; } /// /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; } + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; } /// /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; } + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; } /// /// Type of identity being specified, currently SystemAssigned and None are allowed. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType)""); } + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityType = value ?? null; } /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM @@ -55,17 +55,20 @@ public partial class IotConnectorPatchResource : /// The dictionary values can be empty objects ({}) in requests. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityUserAssignedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).Identity = value ?? null /* model class */; } /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityPrincipalId = value ?? null; } /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)__serviceManagedIdentity).IdentityTenantId = value ?? null; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)__resourceTags1).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)__resourceTags1).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)__resourceTags1).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)__resourceTags1).Tag = value ?? null /* model class */; } /// Creates an new instance. public IotConnectorPatchResource() @@ -90,15 +93,15 @@ public IotConnectorPatchResource() /// Iot Connector patch properties public partial interface IIotConnectorPatchResource : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity { } /// Iot Connector patch properties internal partial interface IIotConnectorPatchResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal { } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorPatchResource.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorPatchResource.json.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorPatchResource.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorPatchResource.json.cs index 75651077fc82..08bfcd1291e7 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorPatchResource.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorPatchResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class IotConnectorPatchResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPatchResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPatchResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPatchResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPatchResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPatchResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPatchResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new IotConnectorPatchResource(json) : null; } @@ -77,8 +77,8 @@ internal IotConnectorPatchResource(Microsoft.Azure.PowerShell.Cmdlets.Healthcare { return; } - __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTags1(json); - __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentity(json); + __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTags1(json); + __serviceManagedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity(json); AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorProperties.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorProperties.PowerShell.cs similarity index 56% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorProperties.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorProperties.PowerShell.cs index c7a194129556..d4895cbc45a2 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorProperties.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class IotConnectorProperties partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new IotConnectorProperties(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.HealthcareApis.Models.Api20211101.IIotConnectorProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new IotConnectorProperties(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,37 +111,37 @@ internal IotConnectorProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("IngestionEndpointConfiguration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).IngestionEndpointConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration) content.GetValueForProperty("IngestionEndpointConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).IngestionEndpointConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotEventHubIngestionEndpointConfigurationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).IngestionEndpointConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration) content.GetValueForProperty("IngestionEndpointConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).IngestionEndpointConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotEventHubIngestionEndpointConfigurationTypeConverter.ConvertFrom); } if (content.Contains("DeviceMapping")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).DeviceMapping = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties) content.GetValueForProperty("DeviceMapping",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).DeviceMapping, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).DeviceMapping = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties) content.GetValueForProperty("DeviceMapping",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).DeviceMapping, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("IngestionEndpointConfigurationEventHubName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationEventHubName = (string) content.GetValueForProperty("IngestionEndpointConfigurationEventHubName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationEventHubName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationEventHubName = (string) content.GetValueForProperty("IngestionEndpointConfigurationEventHubName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationEventHubName, global::System.Convert.ToString); } if (content.Contains("IngestionEndpointConfigurationConsumerGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationConsumerGroup = (string) content.GetValueForProperty("IngestionEndpointConfigurationConsumerGroup",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationConsumerGroup, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationConsumerGroup = (string) content.GetValueForProperty("IngestionEndpointConfigurationConsumerGroup",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationConsumerGroup, global::System.Convert.ToString); } if (content.Contains("IngestionEndpointConfigurationFullyQualifiedEventHubNamespace")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace = (string) content.GetValueForProperty("IngestionEndpointConfigurationFullyQualifiedEventHubNamespace",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace = (string) content.GetValueForProperty("IngestionEndpointConfigurationFullyQualifiedEventHubNamespace",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace, global::System.Convert.ToString); } if (content.Contains("DeviceMappingContent")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).DeviceMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent) content.GetValueForProperty("DeviceMappingContent",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).DeviceMappingContent, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesContentTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).DeviceMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) content.GetValueForProperty("DeviceMappingContent",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).DeviceMappingContent, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesContentTypeConverter.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. @@ -150,31 +156,31 @@ internal IotConnectorProperties(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("IngestionEndpointConfiguration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).IngestionEndpointConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration) content.GetValueForProperty("IngestionEndpointConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).IngestionEndpointConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotEventHubIngestionEndpointConfigurationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).IngestionEndpointConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration) content.GetValueForProperty("IngestionEndpointConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).IngestionEndpointConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotEventHubIngestionEndpointConfigurationTypeConverter.ConvertFrom); } if (content.Contains("DeviceMapping")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).DeviceMapping = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties) content.GetValueForProperty("DeviceMapping",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).DeviceMapping, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).DeviceMapping = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties) content.GetValueForProperty("DeviceMapping",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).DeviceMapping, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("IngestionEndpointConfigurationEventHubName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationEventHubName = (string) content.GetValueForProperty("IngestionEndpointConfigurationEventHubName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationEventHubName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationEventHubName = (string) content.GetValueForProperty("IngestionEndpointConfigurationEventHubName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationEventHubName, global::System.Convert.ToString); } if (content.Contains("IngestionEndpointConfigurationConsumerGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationConsumerGroup = (string) content.GetValueForProperty("IngestionEndpointConfigurationConsumerGroup",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationConsumerGroup, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationConsumerGroup = (string) content.GetValueForProperty("IngestionEndpointConfigurationConsumerGroup",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationConsumerGroup, global::System.Convert.ToString); } if (content.Contains("IngestionEndpointConfigurationFullyQualifiedEventHubNamespace")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace = (string) content.GetValueForProperty("IngestionEndpointConfigurationFullyQualifiedEventHubNamespace",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace = (string) content.GetValueForProperty("IngestionEndpointConfigurationFullyQualifiedEventHubNamespace",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).IngestionEndpointConfigurationFullyQualifiedEventHubNamespace, global::System.Convert.ToString); } if (content.Contains("DeviceMappingContent")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).DeviceMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent) content.GetValueForProperty("DeviceMappingContent",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal)this).DeviceMappingContent, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesContentTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).DeviceMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) content.GetValueForProperty("DeviceMappingContent",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal)this).DeviceMappingContent, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesContentTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -183,6 +189,18 @@ internal IotConnectorProperties(global::System.Management.Automation.PSObject co /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// IoT Connector properties. [System.ComponentModel.TypeConverter(typeof(IotConnectorPropertiesTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorProperties.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorProperties.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorProperties.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorProperties.TypeConverter.cs index dcbeffea103a..45d5cf5202a4 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorProperties.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IIotConnectorProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorProperties.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorProperties.cs similarity index 60% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorProperties.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorProperties.cs index a6fbdbed1157..bf13df593cb1 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorProperties.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorProperties.cs @@ -3,61 +3,61 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// IoT Connector properties. public partial class IotConnectorProperties : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorProperties, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorProperties, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties _deviceMapping; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties _deviceMapping; /// Device Mappings. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties DeviceMapping { get => (this._deviceMapping = this._deviceMapping ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingProperties()); set => this._deviceMapping = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties DeviceMapping { get => (this._deviceMapping = this._deviceMapping ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingProperties()); set => this._deviceMapping = value; } /// The mapping. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent DeviceMappingContent { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesInternal)DeviceMapping).Content; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesInternal)DeviceMapping).Content = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent DeviceMappingContent { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesInternal)DeviceMapping).Content; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesInternal)DeviceMapping).Content = value ?? null /* model class */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration _ingestionEndpointConfiguration; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration _ingestionEndpointConfiguration; /// Source configuration. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration IngestionEndpointConfiguration { get => (this._ingestionEndpointConfiguration = this._ingestionEndpointConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotEventHubIngestionEndpointConfiguration()); set => this._ingestionEndpointConfiguration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration IngestionEndpointConfiguration { get => (this._ingestionEndpointConfiguration = this._ingestionEndpointConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotEventHubIngestionEndpointConfiguration()); set => this._ingestionEndpointConfiguration = value; } /// Consumer group of the event hub to connected to. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string IngestionEndpointConfigurationConsumerGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal)IngestionEndpointConfiguration).ConsumerGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal)IngestionEndpointConfiguration).ConsumerGroup = value ?? null; } + public string IngestionEndpointConfigurationConsumerGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal)IngestionEndpointConfiguration).ConsumerGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal)IngestionEndpointConfiguration).ConsumerGroup = value ?? null; } /// Event Hub name to connect to. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string IngestionEndpointConfigurationEventHubName { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal)IngestionEndpointConfiguration).EventHubName; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal)IngestionEndpointConfiguration).EventHubName = value ?? null; } + public string IngestionEndpointConfigurationEventHubName { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal)IngestionEndpointConfiguration).EventHubName; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal)IngestionEndpointConfiguration).EventHubName = value ?? null; } /// Fully qualified namespace of the Event Hub to connect to. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string IngestionEndpointConfigurationFullyQualifiedEventHubNamespace { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal)IngestionEndpointConfiguration).FullyQualifiedEventHubNamespace; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal)IngestionEndpointConfiguration).FullyQualifiedEventHubNamespace = value ?? null; } + public string IngestionEndpointConfigurationFullyQualifiedEventHubNamespace { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal)IngestionEndpointConfiguration).FullyQualifiedEventHubNamespace; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal)IngestionEndpointConfiguration).FullyQualifiedEventHubNamespace = value ?? null; } /// Internal Acessors for DeviceMapping - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal.DeviceMapping { get => (this._deviceMapping = this._deviceMapping ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingProperties()); set { {_deviceMapping = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal.DeviceMapping { get => (this._deviceMapping = this._deviceMapping ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingProperties()); set { {_deviceMapping = value;} } } /// Internal Acessors for IngestionEndpointConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal.IngestionEndpointConfiguration { get => (this._ingestionEndpointConfiguration = this._ingestionEndpointConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotEventHubIngestionEndpointConfiguration()); set { {_ingestionEndpointConfiguration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal.IngestionEndpointConfiguration { get => (this._ingestionEndpointConfiguration = this._ingestionEndpointConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotEventHubIngestionEndpointConfiguration()); set { {_ingestionEndpointConfiguration = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Creates an new instance. public IotConnectorProperties() @@ -73,14 +73,20 @@ public partial interface IIotConnectorProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The mapping.", SerializedName = @"content", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent DeviceMappingContent { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent DeviceMappingContent { get; set; } /// Consumer group of the event hub to connected to. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Consumer group of the event hub to connected to.", SerializedName = @"consumerGroup", PossibleTypes = new [] { typeof(string) })] @@ -89,6 +95,9 @@ public partial interface IIotConnectorProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Event Hub name to connect to.", SerializedName = @"eventHubName", PossibleTypes = new [] { typeof(string) })] @@ -97,6 +106,9 @@ public partial interface IIotConnectorProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified namespace of the Event Hub to connect to.", SerializedName = @"fullyQualifiedEventHubNamespace", PossibleTypes = new [] { typeof(string) })] @@ -105,10 +117,14 @@ public partial interface IIotConnectorProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; } } /// IoT Connector properties. @@ -116,11 +132,11 @@ internal partial interface IIotConnectorPropertiesInternal { /// Device Mappings. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties DeviceMapping { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties DeviceMapping { get; set; } /// The mapping. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent DeviceMappingContent { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent DeviceMappingContent { get; set; } /// Source configuration. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration IngestionEndpointConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration IngestionEndpointConfiguration { get; set; } /// Consumer group of the event hub to connected to. string IngestionEndpointConfigurationConsumerGroup { get; set; } /// Event Hub name to connect to. @@ -128,7 +144,8 @@ internal partial interface IIotConnectorPropertiesInternal /// Fully qualified namespace of the Event Hub to connect to. string IngestionEndpointConfigurationFullyQualifiedEventHubNamespace { get; set; } /// The provisioning state. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorProperties.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorProperties.json.cs similarity index 92% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorProperties.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorProperties.json.cs index ea66a266a635..218a75d70d34 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotConnectorProperties.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotConnectorProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class IotConnectorProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new IotConnectorProperties(json) : null; } @@ -77,9 +77,9 @@ internal IotConnectorProperties(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApi { return; } - {_ingestionEndpointConfiguration = If( json?.PropertyT("ingestionEndpointConfiguration"), out var __jsonIngestionEndpointConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotEventHubIngestionEndpointConfiguration.FromJson(__jsonIngestionEndpointConfiguration) : IngestionEndpointConfiguration;} - {_deviceMapping = If( json?.PropertyT("deviceMapping"), out var __jsonDeviceMapping) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingProperties.FromJson(__jsonDeviceMapping) : DeviceMapping;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_ingestionEndpointConfiguration = If( json?.PropertyT("ingestionEndpointConfiguration"), out var __jsonIngestionEndpointConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotEventHubIngestionEndpointConfiguration.FromJson(__jsonIngestionEndpointConfiguration) : _ingestionEndpointConfiguration;} + {_deviceMapping = If( json?.PropertyT("deviceMapping"), out var __jsonDeviceMapping) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingProperties.FromJson(__jsonDeviceMapping) : _deviceMapping;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} AfterFromJson(json); } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T } AddIf( null != this._ingestionEndpointConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._ingestionEndpointConfiguration.ToJson(null,serializationMode) : null, "ingestionEndpointConfiguration" ,container.Add ); AddIf( null != this._deviceMapping ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._deviceMapping.ToJson(null,serializationMode) : null, "deviceMapping" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotDestinationProperties.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotDestinationProperties.PowerShell.cs similarity index 76% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotDestinationProperties.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotDestinationProperties.PowerShell.cs index b40c56330855..cc8027355e29 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotDestinationProperties.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotDestinationProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class IotDestinationProperties partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new IotDestinationProperties(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.HealthcareApis.Models.Api20211101.IIotDestinationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new IotDestinationProperties(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,13 +111,13 @@ internal IotDestinationProperties(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationPropertiesInternal)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. @@ -126,7 +132,7 @@ internal IotDestinationProperties(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -135,6 +141,18 @@ internal IotDestinationProperties(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Common IoT Connector destination properties. [System.ComponentModel.TypeConverter(typeof(IotDestinationPropertiesTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotDestinationProperties.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotDestinationProperties.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotDestinationProperties.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotDestinationProperties.TypeConverter.cs index e081cd5e8953..1e9e4c97a326 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotDestinationProperties.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotDestinationProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IIotDestinationProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotDestinationProperties.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotDestinationProperties.cs similarity index 63% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotDestinationProperties.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotDestinationProperties.cs index 1b627594e58f..b6c0c211a51b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotDestinationProperties.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotDestinationProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Common IoT Connector destination properties. public partial class IotDestinationProperties : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationProperties, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationProperties, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationPropertiesInternal { /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Creates an new instance. public IotDestinationProperties() @@ -37,10 +37,14 @@ public partial interface IIotDestinationProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; } } /// Common IoT Connector destination properties. @@ -48,7 +52,8 @@ internal partial interface IIotDestinationPropertiesInternal { /// The provisioning state. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotDestinationProperties.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotDestinationProperties.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotDestinationProperties.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotDestinationProperties.json.cs index 7d44738c2006..104b30b4ebfc 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotDestinationProperties.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotDestinationProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class IotDestinationProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new IotDestinationProperties(json) : null; } @@ -77,7 +77,7 @@ internal IotDestinationProperties(Microsoft.Azure.PowerShell.Cmdlets.HealthcareA { return; } - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} AfterFromJson(json); } @@ -100,7 +100,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotEventHubIngestionEndpointConfiguration.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotEventHubIngestionEndpointConfiguration.PowerShell.cs similarity index 68% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotEventHubIngestionEndpointConfiguration.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotEventHubIngestionEndpointConfiguration.PowerShell.cs index db57a65a03f8..87e02ad4e9c0 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotEventHubIngestionEndpointConfiguration.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotEventHubIngestionEndpointConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class IotEventHubIngestionEndpointConfiguration partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new IotEventHubIngestionEndpointConfiguration(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 . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new IotEventHubIngestionEndpointConfiguration(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. @@ -108,21 +116,21 @@ internal IotEventHubIngestionEndpointConfiguration(global::System.Collections.ID // actually deserialize if (content.Contains("EventHubName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal)this).EventHubName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal)this).EventHubName, global::System.Convert.ToString); } if (content.Contains("ConsumerGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal)this).ConsumerGroup = (string) content.GetValueForProperty("ConsumerGroup",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal)this).ConsumerGroup, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal)this).ConsumerGroup = (string) content.GetValueForProperty("ConsumerGroup",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal)this).ConsumerGroup, global::System.Convert.ToString); } if (content.Contains("FullyQualifiedEventHubNamespace")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal)this).FullyQualifiedEventHubNamespace = (string) content.GetValueForProperty("FullyQualifiedEventHubNamespace",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal)this).FullyQualifiedEventHubNamespace, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal)this).FullyQualifiedEventHubNamespace = (string) content.GetValueForProperty("FullyQualifiedEventHubNamespace",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal)this).FullyQualifiedEventHubNamespace, 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,15 +145,15 @@ internal IotEventHubIngestionEndpointConfiguration(global::System.Management.Aut // actually deserialize if (content.Contains("EventHubName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal)this).EventHubName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal)this).EventHubName, global::System.Convert.ToString); } if (content.Contains("ConsumerGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal)this).ConsumerGroup = (string) content.GetValueForProperty("ConsumerGroup",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal)this).ConsumerGroup, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal)this).ConsumerGroup = (string) content.GetValueForProperty("ConsumerGroup",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal)this).ConsumerGroup, global::System.Convert.ToString); } if (content.Contains("FullyQualifiedEventHubNamespace")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal)this).FullyQualifiedEventHubNamespace = (string) content.GetValueForProperty("FullyQualifiedEventHubNamespace",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal)this).FullyQualifiedEventHubNamespace, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal)this).FullyQualifiedEventHubNamespace = (string) content.GetValueForProperty("FullyQualifiedEventHubNamespace",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal)this).FullyQualifiedEventHubNamespace, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -154,6 +162,18 @@ internal IotEventHubIngestionEndpointConfiguration(global::System.Management.Aut /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Event Hub ingestion endpoint configuration [System.ComponentModel.TypeConverter(typeof(IotEventHubIngestionEndpointConfigurationTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotEventHubIngestionEndpointConfiguration.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotEventHubIngestionEndpointConfiguration.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotEventHubIngestionEndpointConfiguration.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotEventHubIngestionEndpointConfiguration.TypeConverter.cs index 56861dddbf7e..ab5b5fd9fe00 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotEventHubIngestionEndpointConfiguration.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotEventHubIngestionEndpointConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotEventHubIngestionEndpointConfiguration.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotEventHubIngestionEndpointConfiguration.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotEventHubIngestionEndpointConfiguration.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotEventHubIngestionEndpointConfiguration.cs index 221a3c01ff7a..effe9b1c11b1 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotEventHubIngestionEndpointConfiguration.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotEventHubIngestionEndpointConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Event Hub ingestion endpoint configuration public partial class IotEventHubIngestionEndpointConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfigurationInternal { /// Backing field for property. @@ -50,6 +50,9 @@ public partial interface IIotEventHubIngestionEndpointConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Consumer group of the event hub to connected to.", SerializedName = @"consumerGroup", PossibleTypes = new [] { typeof(string) })] @@ -58,6 +61,9 @@ public partial interface IIotEventHubIngestionEndpointConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Event Hub name to connect to.", SerializedName = @"eventHubName", PossibleTypes = new [] { typeof(string) })] @@ -66,6 +72,9 @@ public partial interface IIotEventHubIngestionEndpointConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified namespace of the Event Hub to connect to.", SerializedName = @"fullyQualifiedEventHubNamespace", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotEventHubIngestionEndpointConfiguration.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotEventHubIngestionEndpointConfiguration.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotEventHubIngestionEndpointConfiguration.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotEventHubIngestionEndpointConfiguration.json.cs index 4b04237426c5..9e69faa1d3e7 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotEventHubIngestionEndpointConfiguration.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotEventHubIngestionEndpointConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class IotEventHubIngestionEndpointConfiguration partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotEventHubIngestionEndpointConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotEventHubIngestionEndpointConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new IotEventHubIngestionEndpointConfiguration(json) : null; } @@ -77,9 +77,9 @@ internal IotEventHubIngestionEndpointConfiguration(Microsoft.Azure.PowerShell.Cm { return; } - {_eventHubName = If( json?.PropertyT("eventHubName"), out var __jsonEventHubName) ? (string)__jsonEventHubName : (string)EventHubName;} - {_consumerGroup = If( json?.PropertyT("consumerGroup"), out var __jsonConsumerGroup) ? (string)__jsonConsumerGroup : (string)ConsumerGroup;} - {_fullyQualifiedEventHubNamespace = If( json?.PropertyT("fullyQualifiedEventHubNamespace"), out var __jsonFullyQualifiedEventHubNamespace) ? (string)__jsonFullyQualifiedEventHubNamespace : (string)FullyQualifiedEventHubNamespace;} + {_eventHubName = If( json?.PropertyT("eventHubName"), out var __jsonEventHubName) ? (string)__jsonEventHubName : (string)_eventHubName;} + {_consumerGroup = If( json?.PropertyT("consumerGroup"), out var __jsonConsumerGroup) ? (string)__jsonConsumerGroup : (string)_consumerGroup;} + {_fullyQualifiedEventHubNamespace = If( json?.PropertyT("fullyQualifiedEventHubNamespace"), out var __jsonFullyQualifiedEventHubNamespace) ? (string)__jsonFullyQualifiedEventHubNamespace : (string)_fullyQualifiedEventHubNamespace;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestination.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestination.PowerShell.cs new file mode 100644 index 000000000000..d205ed6e522d --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestination.PowerShell.cs @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + + /// IoT Connector FHIR destination definition. + [System.ComponentModel.TypeConverter(typeof(IotFhirDestinationTypeConverter))] + public partial class IotFhirDestination + { + + /// + /// 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.HealthcareApis.Models.IIotFhirDestination DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IotFhirDestination(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.HealthcareApis.Models.IIotFhirDestination DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IotFhirDestination(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.HealthcareApis.Models.IIotFhirDestination FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IotFhirDestination(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.HealthcareApis.Models.IIotFhirDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FhirMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).FhirMapping = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties) content.GetValueForProperty("FhirMapping",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).FhirMapping, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceIdentityResolutionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).ResourceIdentityResolutionType = (string) content.GetValueForProperty("ResourceIdentityResolutionType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).ResourceIdentityResolutionType, global::System.Convert.ToString); + } + if (content.Contains("FhirServiceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).FhirServiceResourceId = (string) content.GetValueForProperty("FhirServiceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).FhirServiceResourceId, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FhirMappingContent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).FhirMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) content.GetValueForProperty("FhirMappingContent",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).FhirMappingContent, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesContentTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IotFhirDestination(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.HealthcareApis.Models.IIotFhirDestinationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestinationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FhirMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).FhirMapping = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties) content.GetValueForProperty("FhirMapping",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).FhirMapping, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceIdentityResolutionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).ResourceIdentityResolutionType = (string) content.GetValueForProperty("ResourceIdentityResolutionType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).ResourceIdentityResolutionType, global::System.Convert.ToString); + } + if (content.Contains("FhirServiceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).FhirServiceResourceId = (string) content.GetValueForProperty("FhirServiceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).FhirServiceResourceId, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FhirMappingContent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).FhirMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) content.GetValueForProperty("FhirMappingContent",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal)this).FhirMappingContent, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesContentTypeConverter.ConvertFrom); + } + 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.HealthcareApis.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(); + } + } + /// IoT Connector FHIR destination definition. + [System.ComponentModel.TypeConverter(typeof(IotFhirDestinationTypeConverter))] + public partial interface IIotFhirDestination + + { + + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestination.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestination.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestination.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestination.TypeConverter.cs index e6aec351faff..68f116747ebc 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestination.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestination.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IIotFhirDestination ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestination.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestination.cs similarity index 57% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestination.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestination.cs index a4b0a4b74228..38ab270de961 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestination.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestination.cs @@ -3,87 +3,105 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// IoT Connector FHIR destination definition. public partial class IotFhirDestination : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResource __locationBasedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.LocationBasedResource(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResource __locationBasedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.LocationBasedResource(); /// /// An etag associated with the resource, used for optimistic concurrency when editing it. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Etag = value ?? null; } /// The mapping. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent FhirMappingContent { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)Property).FhirMappingContent; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)Property).FhirMappingContent = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent FhirMappingContent { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)Property).FhirMappingContent; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)Property).FhirMappingContent = value ?? null /* model class */; } /// Fully qualified resource id of the FHIR service to connect to. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string FhirServiceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)Property).FhirServiceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)Property).FhirServiceResourceId = value ; } + public string FhirServiceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)Property).FhirServiceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)Property).FhirServiceResourceId = value ; } /// The resource identifier. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Id; } /// The resource location. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.FormatTable(Index = 0)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)__locationBasedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)__locationBasedResource).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)__locationBasedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)__locationBasedResource).Location = value ?? null; } /// Internal Acessors for FhirMapping - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal.FhirMapping { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)Property).FhirMapping; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)Property).FhirMapping = value; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal.FhirMapping { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)Property).FhirMapping; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)Property).FhirMapping = value ?? null /* model class */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotFhirDestinationProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestinationProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationPropertiesInternal)Property).ProvisioningState = value ?? null; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Type = value ?? null; } /// The resource name. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.FormatTable(Index = 1)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationProperties _property; /// IoT FHIR Destination settings. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotFhirDestinationProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestinationProperties()); set => this._property = value; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationPropertiesInternal)Property).ProvisioningState; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] @@ -93,50 +111,50 @@ public partial class IotFhirDestination : /// Determines how resource identity is resolved on the destination. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType ResourceIdentityResolutionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)Property).ResourceIdentityResolutionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)Property).ResourceIdentityResolutionType = value ; } + public string ResourceIdentityResolutionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)Property).ResourceIdentityResolutionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)Property).ResourceIdentityResolutionType = value ; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData _systemData; /// Metadata pertaining to creation and last modification of the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// The resource type. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Type; } /// Creates an new instance. public IotFhirDestination() @@ -159,20 +177,26 @@ public IotFhirDestination() /// IoT Connector FHIR destination definition. public partial interface IIotFhirDestination : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResource { /// The mapping. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The mapping.", SerializedName = @"content", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent FhirMappingContent { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent FhirMappingContent { get; set; } /// Fully qualified resource id of the FHIR service to connect to. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified resource id of the FHIR service to connect to.", SerializedName = @"fhirServiceResourceId", PossibleTypes = new [] { typeof(string) })] @@ -181,98 +205,130 @@ public partial interface IIotFhirDestination : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; } /// Determines how resource identity is resolved on the destination. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Determines how resource identity is resolved on the destination.", SerializedName = @"resourceIdentityResolutionType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType ResourceIdentityResolutionType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Create", "Lookup")] + string ResourceIdentityResolutionType { get; set; } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } + global::System.DateTime? SystemDataCreatedAt { get; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } + string SystemDataCreatedBy { get; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } + global::System.DateTime? SystemDataLastModifiedAt { get; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } + string SystemDataLastModifiedBy { get; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } } /// IoT Connector FHIR destination definition. internal partial interface IIotFhirDestinationInternal : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal { /// FHIR Mappings - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties FhirMapping { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties FhirMapping { get; set; } /// The mapping. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent FhirMappingContent { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent FhirMappingContent { get; set; } /// Fully qualified resource id of the FHIR service to connect to. string FhirServiceResourceId { get; set; } /// IoT FHIR Destination settings. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationProperties Property { get; set; } /// The provisioning state. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; set; } /// Determines how resource identity is resolved on the destination. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType ResourceIdentityResolutionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Create", "Lookup")] + string ResourceIdentityResolutionType { get; set; } /// Metadata pertaining to creation and last modification of the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData SystemData { get; set; } /// The timestamp of resource creation (UTC). global::System.DateTime? SystemDataCreatedAt { get; set; } /// The identity that created the resource. string SystemDataCreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// The identity that last modified the resource. string SystemDataLastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestination.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestination.json.cs similarity index 92% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestination.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestination.json.cs index 23477e1b3495..fabd561af0d4 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestination.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestination.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class IotFhirDestination partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new IotFhirDestination(json) : null; } @@ -77,9 +77,9 @@ internal IotFhirDestination(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Ru { return; } - __locationBasedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.LocationBasedResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotFhirDestinationProperties.FromJson(__jsonProperties) : Property;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData.FromJson(__jsonSystemData) : SystemData;} + __locationBasedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.LocationBasedResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestinationProperties.FromJson(__jsonProperties) : _property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} AfterFromJson(json); } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T } __locationBasedResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationCollection.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationCollection.PowerShell.cs similarity index 69% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationCollection.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationCollection.PowerShell.cs index 994dde918d91..cd22f72438dc 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationCollection.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationCollection.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class IotFhirDestinationCollection partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new IotFhirDestinationCollection(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.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new IotFhirDestinationCollection(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,17 +111,17 @@ internal IotFhirDestinationCollection(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollectionInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollectionInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotFhirDestinationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestinationTypeConverter.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. @@ -130,11 +136,11 @@ internal IotFhirDestinationCollection(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollectionInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollectionInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotFhirDestinationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestinationTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -143,6 +149,18 @@ internal IotFhirDestinationCollection(global::System.Management.Automation.PSObj /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 collection of IoT Connector FHIR destinations. [System.ComponentModel.TypeConverter(typeof(IotFhirDestinationCollectionTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationCollection.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationCollection.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationCollection.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationCollection.TypeConverter.cs index 8bd7331b09f3..6e63c6083809 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationCollection.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationCollection.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollection ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollection ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollection).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollection).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationCollection.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationCollection.cs similarity index 77% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationCollection.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationCollection.cs index 9749d267fe55..29a820662bf4 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationCollection.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationCollection.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// A collection of IoT Connector FHIR destinations. public partial class IotFhirDestinationCollection : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollection, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollectionInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollection, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollectionInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class IotFhirDestinationCollection : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination[] _value; + private System.Collections.Generic.List _value; /// The list of IoT Connector FHIR destinations. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public IotFhirDestinationCollection() @@ -41,6 +41,9 @@ public partial interface IIotFhirDestinationCollection : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link used to get the next page of IoT FHIR destinations.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IIotFhirDestinationCollection : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of IoT Connector FHIR destinations.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination) })] + System.Collections.Generic.List Value { get; set; } } /// A collection of IoT Connector FHIR destinations. @@ -62,7 +68,7 @@ internal partial interface IIotFhirDestinationCollectionInternal /// The link used to get the next page of IoT FHIR destinations. string NextLink { get; set; } /// The list of IoT Connector FHIR destinations. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationCollection.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationCollection.json.cs similarity index 90% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationCollection.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationCollection.json.cs index 972f090cdb84..ad1498120451 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationCollection.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationCollection.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class IotFhirDestinationCollection partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollection. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollection. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollection. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollection. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new IotFhirDestinationCollection(json) : null; } @@ -77,8 +77,8 @@ internal IotFhirDestinationCollection(Microsoft.Azure.PowerShell.Cmdlets.Healthc { return; } - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IIotFhirDestination) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotFhirDestination.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.HealthcareApis.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.HealthcareApis.Models.IIotFhirDestination) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestination.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationProperties.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationProperties.PowerShell.cs similarity index 61% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationProperties.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationProperties.PowerShell.cs index 5ac324e0b008..273e0bb4b7d2 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationProperties.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class IotFhirDestinationProperties partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new IotFhirDestinationProperties(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.HealthcareApis.Models.Api20211101.IIotFhirDestinationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new IotFhirDestinationProperties(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,29 +111,29 @@ internal IotFhirDestinationProperties(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("FhirMapping")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)this).FhirMapping = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties) content.GetValueForProperty("FhirMapping",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)this).FhirMapping, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)this).FhirMapping = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties) content.GetValueForProperty("FhirMapping",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)this).FhirMapping, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesTypeConverter.ConvertFrom); } if (content.Contains("ResourceIdentityResolutionType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)this).ResourceIdentityResolutionType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType) content.GetValueForProperty("ResourceIdentityResolutionType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)this).ResourceIdentityResolutionType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)this).ResourceIdentityResolutionType = (string) content.GetValueForProperty("ResourceIdentityResolutionType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)this).ResourceIdentityResolutionType, global::System.Convert.ToString); } if (content.Contains("FhirServiceResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)this).FhirServiceResourceId = (string) content.GetValueForProperty("FhirServiceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)this).FhirServiceResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)this).FhirServiceResourceId = (string) content.GetValueForProperty("FhirServiceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)this).FhirServiceResourceId, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("FhirMappingContent")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)this).FhirMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent) content.GetValueForProperty("FhirMappingContent",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)this).FhirMappingContent, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesContentTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)this).FhirMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) content.GetValueForProperty("FhirMappingContent",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)this).FhirMappingContent, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesContentTypeConverter.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,23 +148,23 @@ internal IotFhirDestinationProperties(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("FhirMapping")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)this).FhirMapping = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties) content.GetValueForProperty("FhirMapping",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)this).FhirMapping, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)this).FhirMapping = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties) content.GetValueForProperty("FhirMapping",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)this).FhirMapping, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesTypeConverter.ConvertFrom); } if (content.Contains("ResourceIdentityResolutionType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)this).ResourceIdentityResolutionType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType) content.GetValueForProperty("ResourceIdentityResolutionType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)this).ResourceIdentityResolutionType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)this).ResourceIdentityResolutionType = (string) content.GetValueForProperty("ResourceIdentityResolutionType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)this).ResourceIdentityResolutionType, global::System.Convert.ToString); } if (content.Contains("FhirServiceResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)this).FhirServiceResourceId = (string) content.GetValueForProperty("FhirServiceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)this).FhirServiceResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)this).FhirServiceResourceId = (string) content.GetValueForProperty("FhirServiceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)this).FhirServiceResourceId, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("FhirMappingContent")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)this).FhirMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent) content.GetValueForProperty("FhirMappingContent",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal)this).FhirMappingContent, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesContentTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)this).FhirMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) content.GetValueForProperty("FhirMappingContent",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal)this).FhirMappingContent, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesContentTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -167,6 +173,18 @@ internal IotFhirDestinationProperties(global::System.Management.Automation.PSObj /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// IoT Connector destination properties for an Azure FHIR service. [System.ComponentModel.TypeConverter(typeof(IotFhirDestinationPropertiesTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationProperties.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationProperties.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationProperties.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationProperties.TypeConverter.cs index 32402c404168..926973ba2242 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationProperties.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IIotFhirDestinationProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationProperties.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationProperties.cs similarity index 64% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationProperties.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationProperties.cs index aa0c55ff4954..5753a99c936e 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationProperties.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// IoT Connector destination properties for an Azure FHIR service. public partial class IotFhirDestinationProperties : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationProperties, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationProperties, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationProperties __iotDestinationProperties = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotDestinationProperties(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationProperties __iotDestinationProperties = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotDestinationProperties(); /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties _fhirMapping; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties _fhirMapping; /// FHIR Mappings [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties FhirMapping { get => (this._fhirMapping = this._fhirMapping ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingProperties()); set => this._fhirMapping = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties FhirMapping { get => (this._fhirMapping = this._fhirMapping ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingProperties()); set => this._fhirMapping = value; } /// The mapping. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent FhirMappingContent { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesInternal)FhirMapping).Content; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesInternal)FhirMapping).Content = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent FhirMappingContent { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesInternal)FhirMapping).Content; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesInternal)FhirMapping).Content = value ?? null /* model class */; } /// Backing field for property. private string _fhirServiceResourceId; @@ -38,21 +38,21 @@ public partial class IotFhirDestinationProperties : public string FhirServiceResourceId { get => this._fhirServiceResourceId; set => this._fhirServiceResourceId = value; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationPropertiesInternal)__iotDestinationProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationPropertiesInternal)__iotDestinationProperties).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationPropertiesInternal)__iotDestinationProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationPropertiesInternal)__iotDestinationProperties).ProvisioningState = value ?? null; } /// Internal Acessors for FhirMapping - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationPropertiesInternal.FhirMapping { get => (this._fhirMapping = this._fhirMapping ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingProperties()); set { {_fhirMapping = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationPropertiesInternal.FhirMapping { get => (this._fhirMapping = this._fhirMapping ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingProperties()); set { {_fhirMapping = value;} } } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationPropertiesInternal)__iotDestinationProperties).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationPropertiesInternal)__iotDestinationProperties).ProvisioningState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType _resourceIdentityResolutionType; + private string _resourceIdentityResolutionType; /// Determines how resource identity is resolved on the destination. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType ResourceIdentityResolutionType { get => this._resourceIdentityResolutionType; set => this._resourceIdentityResolutionType = value; } + public string ResourceIdentityResolutionType { get => this._resourceIdentityResolutionType; set => this._resourceIdentityResolutionType = value; } /// Creates an new instance. public IotFhirDestinationProperties() @@ -75,20 +75,26 @@ public IotFhirDestinationProperties() /// IoT Connector destination properties for an Azure FHIR service. public partial interface IIotFhirDestinationProperties : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationProperties + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationProperties { /// The mapping. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The mapping.", SerializedName = @"content", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent FhirMappingContent { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent FhirMappingContent { get; set; } /// Fully qualified resource id of the FHIR service to connect to. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified resource id of the FHIR service to connect to.", SerializedName = @"fhirServiceResourceId", PossibleTypes = new [] { typeof(string) })] @@ -97,24 +103,29 @@ public partial interface IIotFhirDestinationProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Determines how resource identity is resolved on the destination.", SerializedName = @"resourceIdentityResolutionType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType ResourceIdentityResolutionType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Create", "Lookup")] + string ResourceIdentityResolutionType { get; set; } } /// IoT Connector destination properties for an Azure FHIR service. internal partial interface IIotFhirDestinationPropertiesInternal : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotDestinationPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotDestinationPropertiesInternal { /// FHIR Mappings - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties FhirMapping { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties FhirMapping { get; set; } /// The mapping. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent FhirMappingContent { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent FhirMappingContent { get; set; } /// Fully qualified resource id of the FHIR service to connect to. string FhirServiceResourceId { get; set; } /// Determines how resource identity is resolved on the destination. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType ResourceIdentityResolutionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Create", "Lookup")] + string ResourceIdentityResolutionType { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationProperties.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationProperties.json.cs similarity index 92% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationProperties.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationProperties.json.cs index 380ed228e920..b854c14e5d10 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotFhirDestinationProperties.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotFhirDestinationProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class IotFhirDestinationProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new IotFhirDestinationProperties(json) : null; } @@ -77,10 +77,10 @@ internal IotFhirDestinationProperties(Microsoft.Azure.PowerShell.Cmdlets.Healthc { return; } - __iotDestinationProperties = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotDestinationProperties(json); - {_fhirMapping = If( json?.PropertyT("fhirMapping"), out var __jsonFhirMapping) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingProperties.FromJson(__jsonFhirMapping) : FhirMapping;} - {_resourceIdentityResolutionType = If( json?.PropertyT("resourceIdentityResolutionType"), out var __jsonResourceIdentityResolutionType) ? (string)__jsonResourceIdentityResolutionType : (string)ResourceIdentityResolutionType;} - {_fhirServiceResourceId = If( json?.PropertyT("fhirServiceResourceId"), out var __jsonFhirServiceResourceId) ? (string)__jsonFhirServiceResourceId : (string)FhirServiceResourceId;} + __iotDestinationProperties = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotDestinationProperties(json); + {_fhirMapping = If( json?.PropertyT("fhirMapping"), out var __jsonFhirMapping) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingProperties.FromJson(__jsonFhirMapping) : _fhirMapping;} + {_resourceIdentityResolutionType = If( json?.PropertyT("resourceIdentityResolutionType"), out var __jsonResourceIdentityResolutionType) ? (string)__jsonResourceIdentityResolutionType : (string)_resourceIdentityResolutionType;} + {_fhirServiceResourceId = If( json?.PropertyT("fhirServiceResourceId"), out var __jsonFhirServiceResourceId) ? (string)__jsonFhirServiceResourceId : (string)_fhirServiceResourceId;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingProperties.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingProperties.PowerShell.cs similarity index 74% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingProperties.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingProperties.PowerShell.cs index a1c57654da51..a607e1b72875 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingProperties.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class IotMappingProperties partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new IotMappingProperties(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.HealthcareApis.Models.Api20211101.IIotMappingProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new IotMappingProperties(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,13 +111,13 @@ internal IotMappingProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Content")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesInternal)this).Content = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent) content.GetValueForProperty("Content",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesInternal)this).Content, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesContentTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesInternal)this).Content = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) content.GetValueForProperty("Content",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesInternal)this).Content, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesContentTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -126,7 +132,7 @@ internal IotMappingProperties(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("Content")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesInternal)this).Content = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent) content.GetValueForProperty("Content",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesInternal)this).Content, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesContentTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesInternal)this).Content = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) content.GetValueForProperty("Content",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesInternal)this).Content, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesContentTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -135,6 +141,18 @@ internal IotMappingProperties(global::System.Management.Automation.PSObject cont /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 mapping content. [System.ComponentModel.TypeConverter(typeof(IotMappingPropertiesTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingProperties.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingProperties.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingProperties.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingProperties.TypeConverter.cs index a7acdff14979..b8d42e94d1ee 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingProperties.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IIotMappingProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingProperties.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingProperties.cs similarity index 77% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingProperties.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingProperties.cs index 9f443db2e766..4b43bec2c506 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingProperties.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The mapping content. public partial class IotMappingProperties : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent _content; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent _content; /// The mapping. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent Content { get => (this._content = this._content ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesContent()); set => this._content = value; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent Content { get => (this._content = this._content ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesContent()); set => this._content = value; } /// Creates an new instance. public IotMappingProperties() @@ -34,10 +34,13 @@ public partial interface IIotMappingProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The mapping.", SerializedName = @"content", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent Content { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent Content { get; set; } } /// The mapping content. @@ -45,7 +48,7 @@ internal partial interface IIotMappingPropertiesInternal { /// The mapping. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent Content { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent Content { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingProperties.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingProperties.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingProperties.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingProperties.json.cs index 87d8ccb0555b..181fa4349477 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingProperties.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class IotMappingProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new IotMappingProperties(json) : null; } @@ -77,7 +77,7 @@ internal IotMappingProperties(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis. { return; } - {_content = If( json?.PropertyT("content"), out var __jsonContent) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotMappingPropertiesContent.FromJson(__jsonContent) : Content;} + {_content = If( json?.PropertyT("content"), out var __jsonContent) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesContent.FromJson(__jsonContent) : _content;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingPropertiesContent.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingPropertiesContent.PowerShell.cs similarity index 80% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingPropertiesContent.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingPropertiesContent.PowerShell.cs index 348425ef8377..e9284359fe8a 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingPropertiesContent.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingPropertiesContent.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class IotMappingPropertiesContent partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new IotMappingPropertiesContent(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.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new IotMappingPropertiesContent(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. @@ -109,7 +115,7 @@ internal IotMappingPropertiesContent(global::System.Collections.IDictionary cont } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -131,6 +137,18 @@ internal IotMappingPropertiesContent(global::System.Management.Automation.PSObje /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 mapping. [System.ComponentModel.TypeConverter(typeof(IotMappingPropertiesContentTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingPropertiesContent.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingPropertiesContent.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingPropertiesContent.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingPropertiesContent.TypeConverter.cs index fee024734c93..62b08bd1d2bf 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingPropertiesContent.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingPropertiesContent.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingPropertiesContent.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingPropertiesContent.cs similarity index 92% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingPropertiesContent.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingPropertiesContent.cs index 650bf95b8b1c..e3edaa41ac27 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingPropertiesContent.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingPropertiesContent.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The mapping. public partial class IotMappingPropertiesContent : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContentInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContentInternal { /// Creates an new instance. diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingPropertiesContent.dictionary.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingPropertiesContent.dictionary.cs similarity index 96% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingPropertiesContent.dictionary.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingPropertiesContent.dictionary.cs index 508da17414d7..d65e8a7fa59d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingPropertiesContent.dictionary.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingPropertiesContent.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IotMappingPropertiesContent source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotMappingPropertiesContent source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingPropertiesContent.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingPropertiesContent.json.cs similarity index 95% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingPropertiesContent.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingPropertiesContent.json.cs index 5d92c4540863..32b91f42d942 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/IotMappingPropertiesContent.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/IotMappingPropertiesContent.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class IotMappingPropertiesContent partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new IotMappingPropertiesContent(json) : null; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ListOperations.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ListOperations.PowerShell.cs similarity index 70% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ListOperations.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ListOperations.PowerShell.cs index 2996e6cfc695..5dc26f64c467 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ListOperations.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ListOperations.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class ListOperations partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IListOperations DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperations DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ListOperations(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.HealthcareApis.Models.Api20211101.IListOperations DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperations DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ListOperations(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IListOperations FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperations FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,17 +111,17 @@ internal ListOperations(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IListOperationsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IListOperationsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperationsInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperationsInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationDetailTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IListOperationsInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IListOperationsInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperationsInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperationsInternal)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. @@ -128,11 +136,11 @@ internal ListOperations(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IListOperationsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IListOperationsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperationsInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperationsInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationDetailTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IListOperationsInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IListOperationsInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperationsInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperationsInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -141,6 +149,18 @@ internal ListOperations(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Available operations of the service [System.ComponentModel.TypeConverter(typeof(ListOperationsTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ListOperations.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ListOperations.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ListOperations.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ListOperations.TypeConverter.cs index a836d1ff7f60..d8d899cf1df1 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ListOperations.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ListOperations.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IListOperations ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperations ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IListOperations).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperations).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ListOperations.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ListOperations.cs similarity index 75% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ListOperations.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ListOperations.cs index 953b4537a177..2169f57f4d65 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ListOperations.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ListOperations.cs @@ -3,18 +3,18 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Available operations of the service public partial class ListOperations : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IListOperations, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IListOperationsInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperations, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperationsInternal { /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail[] Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IListOperationsInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperationsInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class ListOperations : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail[] _value; + private System.Collections.Generic.List _value; /// Collection of available operation details [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public ListOperations() @@ -50,6 +50,9 @@ public partial interface IListOperations : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"URL client should use to fetch the next page (per server side paging). It's null for now, added for future use.", SerializedName = @"nextLink", @@ -59,10 +62,13 @@ public partial interface IListOperations : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Collection of available operation details", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetail) })] + System.Collections.Generic.List Value { get; } } /// Available operations of the service @@ -75,7 +81,7 @@ internal partial interface IListOperationsInternal /// string NextLink { get; set; } /// Collection of available operation details - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ListOperations.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ListOperations.json.cs similarity index 91% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ListOperations.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ListOperations.json.cs index bce87154f7e9..45f53188e619 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ListOperations.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ListOperations.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ListOperations partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IListOperations. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperations. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IListOperations. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperations. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IListOperations FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperations FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ListOperations(json) : null; } @@ -77,8 +77,8 @@ internal ListOperations(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtim { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IOperationDetail) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationDetail.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.HealthcareApis.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.HealthcareApis.Models.IOperationDetail) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationDetail.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.HealthcareApis.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LocationBasedResource.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LocationBasedResource.PowerShell.cs similarity index 68% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LocationBasedResource.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LocationBasedResource.PowerShell.cs index 70b69bc96968..6eec354476ad 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LocationBasedResource.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LocationBasedResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class LocationBasedResource partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new LocationBasedResource(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.HealthcareApis.Models.Api20211101.ILocationBasedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new LocationBasedResource(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,29 +111,29 @@ internal LocationBasedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag, 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,23 +148,23 @@ internal LocationBasedResource(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -167,6 +173,18 @@ internal LocationBasedResource(global::System.Management.Automation.PSObject con /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 common properties for any location based resource, tracked or proxy. [System.ComponentModel.TypeConverter(typeof(LocationBasedResourceTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LocationBasedResource.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LocationBasedResource.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LocationBasedResource.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LocationBasedResource.TypeConverter.cs index ef818757817f..fb769c1d6eea 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LocationBasedResource.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LocationBasedResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.ILocationBasedResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LocationBasedResource.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LocationBasedResource.cs similarity index 73% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LocationBasedResource.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LocationBasedResource.cs index da8516a6de8b..d29d7f339da4 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LocationBasedResource.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LocationBasedResource.cs @@ -3,31 +3,31 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The common properties for any location based resource, tracked or proxy. public partial class LocationBasedResource : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResource, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResource, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCore __resourceCore = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceCore(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCore __resourceCore = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceCore(); /// /// An etag associated with the resource, used for optimistic concurrency when editing it. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__resourceCore).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__resourceCore).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__resourceCore).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__resourceCore).Etag = value ?? null; } /// The resource identifier. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__resourceCore).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__resourceCore).Id; } /// Backing field for property. private string _location; @@ -37,21 +37,21 @@ public partial class LocationBasedResource : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__resourceCore).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__resourceCore).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__resourceCore).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__resourceCore).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__resourceCore).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__resourceCore).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__resourceCore).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__resourceCore).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__resourceCore).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__resourceCore).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__resourceCore).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__resourceCore).Type = value ?? null; } /// The resource name. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__resourceCore).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__resourceCore).Name; } /// The resource type. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__resourceCore).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__resourceCore).Type; } /// Creates an new instance. public LocationBasedResource() @@ -74,12 +74,15 @@ public LocationBasedResource() /// The common properties for any location based resource, tracked or proxy. public partial interface ILocationBasedResource : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCore + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCore { /// The resource location. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The resource location.", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -88,7 +91,7 @@ public partial interface ILocationBasedResource : } /// The common properties for any location based resource, tracked or proxy. internal partial interface ILocationBasedResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal { /// The resource location. string Location { get; set; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LocationBasedResource.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LocationBasedResource.json.cs similarity index 88% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LocationBasedResource.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LocationBasedResource.json.cs index 4d4d70fe6404..ed92caa81373 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LocationBasedResource.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LocationBasedResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class LocationBasedResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new LocationBasedResource(json) : null; } @@ -77,8 +77,8 @@ internal LocationBasedResource(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis { return; } - __resourceCore = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceCore(json); - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + __resourceCore = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceCore(json); + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } @@ -102,7 +102,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T return container; } __resourceCore?.ToJson(container, serializationMode); - AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + } AfterToJson(ref container); return container; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LogSpecification.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LogSpecification.PowerShell.cs similarity index 71% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LogSpecification.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LogSpecification.PowerShell.cs index 086e93618f8a..338b20955e5a 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LogSpecification.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class LogSpecification partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.ILogSpecification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new LogSpecification(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,21 +111,21 @@ internal LogSpecification(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecificationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecificationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecificationInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecificationInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("BlobDuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecificationInternal)this).BlobDuration = (string) content.GetValueForProperty("BlobDuration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecificationInternal)this).BlobDuration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecificationInternal)this).BlobDuration = (string) content.GetValueForProperty("BlobDuration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. @@ -132,15 +140,15 @@ internal LogSpecification(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecificationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecificationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecificationInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecificationInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("BlobDuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecificationInternal)this).BlobDuration = (string) content.GetValueForProperty("BlobDuration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecificationInternal)this).BlobDuration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecificationInternal)this).BlobDuration = (string) content.GetValueForProperty("BlobDuration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecificationInternal)this).BlobDuration, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -149,6 +157,18 @@ internal LogSpecification(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Specifications of the Log for Azure Monitoring [System.ComponentModel.TypeConverter(typeof(LogSpecificationTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LogSpecification.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LogSpecification.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LogSpecification.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LogSpecification.TypeConverter.cs index 7e4295c23341..5ce0a7ec2dfd 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LogSpecification.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.ILogSpecification ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecification ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecification).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LogSpecification.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LogSpecification.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LogSpecification.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LogSpecification.cs index 688bbde4c61d..054d1c343f07 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LogSpecification.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Specifications of the Log for Azure Monitoring public partial class LogSpecification : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecificationInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecification, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecificationInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface ILogSpecification : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LogSpecification.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LogSpecification.json.cs similarity index 95% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LogSpecification.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/LogSpecification.json.cs index 5d53c0a01376..dcb9a620fe0f 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/LogSpecification.json.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class LogSpecification partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecification. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecification. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new LogSpecification(json) : null; } @@ -77,9 +77,9 @@ internal LogSpecification(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runt { 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/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricDimension.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/MetricDimension.PowerShell.cs similarity index 71% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricDimension.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/MetricDimension.PowerShell.cs index fc76748c9ed4..7605ec533899 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricDimension.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class MetricDimension partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimension DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IMetricDimension DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimension DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MetricDimension(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimension FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimension FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,21 +111,21 @@ internal MetricDimension(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimensionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimensionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimensionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimensionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimensionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimensionInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimensionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimensionInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("ToBeExportedForShoebox")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimensionInternal)this).ToBeExportedForShoebox = (bool?) content.GetValueForProperty("ToBeExportedForShoebox",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimensionInternal)this).ToBeExportedForShoebox, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimensionInternal)this).ToBeExportedForShoebox = (bool?) content.GetValueForProperty("ToBeExportedForShoebox",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. @@ -132,15 +140,15 @@ internal MetricDimension(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimensionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimensionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimensionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimensionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimensionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimensionInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimensionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimensionInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("ToBeExportedForShoebox")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimensionInternal)this).ToBeExportedForShoebox = (bool?) content.GetValueForProperty("ToBeExportedForShoebox",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimensionInternal)this).ToBeExportedForShoebox, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimensionInternal)this).ToBeExportedForShoebox = (bool?) content.GetValueForProperty("ToBeExportedForShoebox",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimensionInternal)this).ToBeExportedForShoebox, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -149,6 +157,18 @@ internal MetricDimension(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Specifications of the Dimension of metrics [System.ComponentModel.TypeConverter(typeof(MetricDimensionTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricDimension.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/MetricDimension.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricDimension.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/MetricDimension.TypeConverter.cs index ef9c5dbb6394..de342b36d3be 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricDimension.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IMetricDimension ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimension ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimension).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimension).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricDimension.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/MetricDimension.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricDimension.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/MetricDimension.cs index 8e71906b8753..c2c80f9b8493 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricDimension.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Specifications of the Dimension of metrics public partial class MetricDimension : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimension, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimensionInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimension, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimensionInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IMetricDimension : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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) })] @@ -56,6 +59,9 @@ public partial interface IMetricDimension : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the dimension", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IMetricDimension : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether this dimension should be included for the Shoebox export scenario", SerializedName = @"toBeExportedForShoebox", PossibleTypes = new [] { typeof(bool) })] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricDimension.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/MetricDimension.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricDimension.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/MetricDimension.json.cs index bd3fb1ddb244..0bb0a5c02dad 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricDimension.json.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MetricDimension partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimension. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimension. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimension. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimension. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimension FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimension FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new MetricDimension(json) : null; } @@ -77,9 +77,9 @@ internal MetricDimension(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runti { 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;} - {_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;} + {_toBeExportedForShoebox = If( json?.PropertyT("toBeExportedForShoebox"), out var __jsonToBeExportedForShoebox) ? (bool?)__jsonToBeExportedForShoebox : _toBeExportedForShoebox;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricSpecification.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/MetricSpecification.PowerShell.cs similarity index 54% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricSpecification.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/MetricSpecification.PowerShell.cs index 45cbbb7b1c17..cd5faaf1aaf2 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricSpecification.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class MetricSpecification partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IMetricSpecification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MetricSpecification(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,53 +111,53 @@ internal MetricSpecification(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).DisplayDescription, global::System.Convert.ToString); } if (content.Contains("Unit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).Unit, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).Unit, global::System.Convert.ToString); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("AggregationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).AggregationType = (string) content.GetValueForProperty("AggregationType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).AggregationType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).AggregationType = (string) content.GetValueForProperty("AggregationType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).AggregationType, global::System.Convert.ToString); } if (content.Contains("SupportedAggregationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).SupportedAggregationType = (string[]) content.GetValueForProperty("SupportedAggregationType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).SupportedAggregationType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).SupportedAggregationType = (System.Collections.Generic.List) content.GetValueForProperty("SupportedAggregationType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).SupportedAggregationType, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("SupportedTimeGrainType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).SupportedTimeGrainType = (string[]) content.GetValueForProperty("SupportedTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).SupportedTimeGrainType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).SupportedTimeGrainType = (System.Collections.Generic.List) content.GetValueForProperty("SupportedTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).SupportedTimeGrainType, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("FillGapWithZero")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).FillGapWithZero = (bool?) content.GetValueForProperty("FillGapWithZero",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).FillGapWithZero, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).FillGapWithZero = (bool?) content.GetValueForProperty("FillGapWithZero",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).FillGapWithZero, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Dimension")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimension[]) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).Dimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.MetricDimensionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).Dimension = (System.Collections.Generic.List) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).Dimension, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.MetricDimensionTypeConverter.ConvertFrom)); } if (content.Contains("SourceMdmNamespace")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).SourceMdmNamespace = (string) content.GetValueForProperty("SourceMdmNamespace",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).SourceMdmNamespace, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).SourceMdmNamespace = (string) content.GetValueForProperty("SourceMdmNamespace",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. @@ -164,47 +172,47 @@ internal MetricSpecification(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).DisplayDescription, global::System.Convert.ToString); } if (content.Contains("Unit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).Unit, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).Unit, global::System.Convert.ToString); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("AggregationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).AggregationType = (string) content.GetValueForProperty("AggregationType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).AggregationType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).AggregationType = (string) content.GetValueForProperty("AggregationType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).AggregationType, global::System.Convert.ToString); } if (content.Contains("SupportedAggregationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).SupportedAggregationType = (string[]) content.GetValueForProperty("SupportedAggregationType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).SupportedAggregationType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).SupportedAggregationType = (System.Collections.Generic.List) content.GetValueForProperty("SupportedAggregationType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).SupportedAggregationType, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("SupportedTimeGrainType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).SupportedTimeGrainType = (string[]) content.GetValueForProperty("SupportedTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).SupportedTimeGrainType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).SupportedTimeGrainType = (System.Collections.Generic.List) content.GetValueForProperty("SupportedTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).SupportedTimeGrainType, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("FillGapWithZero")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).FillGapWithZero = (bool?) content.GetValueForProperty("FillGapWithZero",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).FillGapWithZero, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).FillGapWithZero = (bool?) content.GetValueForProperty("FillGapWithZero",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).FillGapWithZero, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Dimension")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimension[]) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).Dimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.MetricDimensionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).Dimension = (System.Collections.Generic.List) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).Dimension, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.MetricDimensionTypeConverter.ConvertFrom)); } if (content.Contains("SourceMdmNamespace")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).SourceMdmNamespace = (string) content.GetValueForProperty("SourceMdmNamespace",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal)this).SourceMdmNamespace, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).SourceMdmNamespace = (string) content.GetValueForProperty("SourceMdmNamespace",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecificationInternal)this).SourceMdmNamespace, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -213,6 +221,18 @@ internal MetricSpecification(global::System.Management.Automation.PSObject conte /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Specifications of the Metrics for Azure Monitoring [System.ComponentModel.TypeConverter(typeof(MetricSpecificationTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricSpecification.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/MetricSpecification.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricSpecification.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/MetricSpecification.TypeConverter.cs index 6348c6ac1132..89a9b76e7f94 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricSpecification.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IMetricSpecification ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecification ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecification).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricSpecification.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/MetricSpecification.cs similarity index 83% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricSpecification.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/MetricSpecification.cs index 75cf226c5eab..c4deb8ff4877 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricSpecification.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Specifications of the Metrics for Azure Monitoring public partial class MetricSpecification : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecificationInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecification, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IMetricDimension[] _dimension; + private System.Collections.Generic.List _dimension; /// Dimensions of the metric [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.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; @@ -76,18 +76,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.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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; @@ -112,6 +112,9 @@ public partial interface IMetricSpecification : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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) })] @@ -122,6 +125,9 @@ public partial interface IMetricSpecification : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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) })] @@ -130,14 +136,20 @@ public partial interface IMetricSpecification : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IMetricDimension) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricDimension[] Dimension { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricDimension) })] + System.Collections.Generic.List Dimension { get; set; } /// Localized friendly description of the metric [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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) })] @@ -146,6 +158,9 @@ public partial interface IMetricSpecification : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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) })] @@ -156,6 +171,9 @@ public partial interface IMetricSpecification : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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) })] @@ -164,6 +182,9 @@ public partial interface IMetricSpecification : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the metric", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -172,6 +193,9 @@ public partial interface IMetricSpecification : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the MDM namespace. Optional.", SerializedName = @"sourceMdmNamespace", PossibleTypes = new [] { typeof(string) })] @@ -180,22 +204,31 @@ public partial interface IMetricSpecification : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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) })] @@ -215,7 +248,7 @@ internal partial interface IMetricSpecificationInternal /// string Category { get; set; } /// Dimensions of the metric - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.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 @@ -229,9 +262,9 @@ internal partial interface IMetricSpecificationInternal /// Name of the MDM namespace. Optional. 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/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricSpecification.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/MetricSpecification.json.cs similarity index 87% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricSpecification.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/MetricSpecification.json.cs index 35b157458ffc..570e43a59c32 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/MetricSpecification.json.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MetricSpecification partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecification. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecification. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new MetricSpecification(json) : null; } @@ -77,17 +77,17 @@ internal MetricSpecification(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.R { 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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Models.Api20211101.IMetricDimension) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.MetricDimension.FromJson(__k) )) ))() : null : Dimension;} - {_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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Models.IMetricDimension) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.MetricDimension.FromJson(__k) )) ))() : null : _dimension;} + {_sourceMdmNamespace = If( json?.PropertyT("sourceMdmNamespace"), out var __jsonSourceMdmNamespace) ? (string)__jsonSourceMdmNamespace : (string)_sourceMdmNamespace;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDetail.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDetail.PowerShell.cs similarity index 50% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDetail.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDetail.PowerShell.cs index bc223b483089..b0ddcba61489 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDetail.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDetail.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class OperationDetail partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationDetail(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.HealthcareApis.Models.Api20211101.IOperationDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationDetail(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,61 +111,61 @@ internal OperationDetail(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("IsDataAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Origin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).Origin, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).Origin, global::System.Convert.ToString); } if (content.Contains("ActionType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).ActionType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ActionType?) content.GetValueForProperty("ActionType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).ActionType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ActionType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).ActionType = (string) content.GetValueForProperty("ActionType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).ActionType, global::System.Convert.ToString); } if (content.Contains("ServiceSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceSpecificationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceSpecificationTypeConverter.ConvertFrom); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).DisplayDescription, global::System.Convert.ToString); } if (content.Contains("ServiceSpecificationLogSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).ServiceSpecificationLogSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification[]) content.GetValueForProperty("ServiceSpecificationLogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).ServiceSpecificationLogSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.LogSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).ServiceSpecificationLogSpecification = (System.Collections.Generic.List) content.GetValueForProperty("ServiceSpecificationLogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).ServiceSpecificationLogSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.LogSpecificationTypeConverter.ConvertFrom)); } if (content.Contains("ServiceSpecificationMetricSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.MetricSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).ServiceSpecificationMetricSpecification = (System.Collections.Generic.List) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. @@ -172,55 +180,55 @@ internal OperationDetail(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("IsDataAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Origin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).Origin, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).Origin, global::System.Convert.ToString); } if (content.Contains("ActionType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).ActionType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ActionType?) content.GetValueForProperty("ActionType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).ActionType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ActionType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).ActionType = (string) content.GetValueForProperty("ActionType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).ActionType, global::System.Convert.ToString); } if (content.Contains("ServiceSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceSpecificationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceSpecificationTypeConverter.ConvertFrom); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).DisplayDescription, global::System.Convert.ToString); } if (content.Contains("ServiceSpecificationLogSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).ServiceSpecificationLogSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification[]) content.GetValueForProperty("ServiceSpecificationLogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).ServiceSpecificationLogSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.LogSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).ServiceSpecificationLogSpecification = (System.Collections.Generic.List) content.GetValueForProperty("ServiceSpecificationLogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).ServiceSpecificationLogSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.LogSpecificationTypeConverter.ConvertFrom)); } if (content.Contains("ServiceSpecificationMetricSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.MetricSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).ServiceSpecificationMetricSpecification = (System.Collections.Generic.List) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.MetricSpecificationTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -229,6 +237,18 @@ internal OperationDetail(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Service REST API operation. [System.ComponentModel.TypeConverter(typeof(OperationDetailTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDetail.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDetail.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDetail.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDetail.TypeConverter.cs index 97f3ed36163c..89bfa044bb26 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDetail.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDetail.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IOperationDetail ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetail ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetail).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDetail.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDetail.cs similarity index 65% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDetail.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDetail.cs index 8d3d9c0c9539..f1ae7a342298 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDetail.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDetail.cs @@ -3,47 +3,47 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Service REST API operation. public partial class OperationDetail : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetail, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ActionType? _actionType; + private string _actionType; /// /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ActionType? ActionType { get => this._actionType; } + public string ActionType { get => this._actionType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplay _display; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplay _display; /// Display of the operation [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationDisplay()); set => this._display = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationDisplay()); set => this._display = value; } /// Friendly description for the operation, [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)Display).Description; } + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)Display).Description; } /// Name of the operation [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)Display).Operation; } + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)Display).Operation; } /// Service provider: Microsoft.HealthcareApis [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)Display).Provider; } + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)Display).Provider; } /// Resource Type: Services [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)Display).Resource; } + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)Display).Resource; } /// Backing field for property. private bool? _isDataAction; @@ -56,37 +56,37 @@ public partial class OperationDetail : public bool? IsDataAction { get => this._isDataAction; } /// Internal Acessors for ActionType - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ActionType? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal.ActionType { get => this._actionType; set { {_actionType = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal.ActionType { get => this._actionType; set { {_actionType = value;} } } /// Internal Acessors for Display - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationDisplay()); set { {_display = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationDisplay()); set { {_display = value;} } } /// Internal Acessors for DisplayDescription - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)Display).Description = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)Display).Description = value ?? null; } /// Internal Acessors for DisplayOperation - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)Display).Operation = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)Display).Operation = value ?? null; } /// Internal Acessors for DisplayProvider - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)Display).Provider = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)Display).Provider = value ?? null; } /// Internal Acessors for DisplayResource - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)Display).Resource = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)Display).Resource = value ?? null; } /// Internal Acessors for IsDataAction - bool? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal.IsDataAction { get => this._isDataAction; set { {_isDataAction = value;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal.IsDataAction { get => this._isDataAction; set { {_isDataAction = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Origin - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal.Origin { get => this._origin; set { {_origin = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal.Origin { get => this._origin; set { {_origin = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationProperties()); set { {_property = value;} } } /// Internal Acessors for ServiceSpecification - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecification Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetailInternal.ServiceSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal)Property).ServiceSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal)Property).ServiceSpecification = value; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecification Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetailInternal.ServiceSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal)Property).ServiceSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal)Property).ServiceSpecification = value ?? null /* model class */; } /// Backing field for property. private string _name; @@ -103,19 +103,19 @@ public partial class OperationDetail : public string Origin { get => this._origin; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationProperties _property; /// Properties of the operation [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationProperties()); set => this._property = value; } /// Specifications of the Log for Azure Monitoring [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification[] ServiceSpecificationLogSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal)Property).ServiceSpecificationLogSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal)Property).ServiceSpecificationLogSpecification = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ServiceSpecificationLogSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal)Property).ServiceSpecificationLogSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal)Property).ServiceSpecificationLogSpecification = value ?? null /* arrayOf */; } /// Specifications of the Metrics for Azure Monitoring [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification[] ServiceSpecificationMetricSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal)Property).ServiceSpecificationMetricSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal)Property).ServiceSpecificationMetricSpecification = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ServiceSpecificationMetricSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal)Property).ServiceSpecificationMetricSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal)Property).ServiceSpecificationMetricSpecification = value ?? null /* arrayOf */; } /// Creates an new instance. public OperationDetail() @@ -133,14 +133,21 @@ public partial interface IOperationDetail : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Enum. Indicates the action type. ""Internal"" refers to actions that are for internal only APIs.", SerializedName = @"actionType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ActionType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ActionType? ActionType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Internal")] + string ActionType { get; } /// Friendly description for the operation, [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Friendly description for the operation,", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -149,6 +156,9 @@ public partial interface IOperationDetail : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Name of the operation", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -157,6 +167,9 @@ public partial interface IOperationDetail : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Service provider: Microsoft.HealthcareApis", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -165,6 +178,9 @@ public partial interface IOperationDetail : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource Type: Services", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] @@ -176,6 +192,9 @@ public partial interface IOperationDetail : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Whether the operation applies to data-plane. This is ""true"" for data-plane operations and ""false"" for ARM/control-plane operations.", SerializedName = @"isDataAction", PossibleTypes = new [] { typeof(bool) })] @@ -184,6 +203,9 @@ public partial interface IOperationDetail : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Name of the operation", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -192,6 +214,9 @@ public partial interface IOperationDetail : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Default value is 'user,system'.", SerializedName = @"origin", PossibleTypes = new [] { typeof(string) })] @@ -200,18 +225,24 @@ public partial interface IOperationDetail : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.ILogSpecification) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification[] ServiceSpecificationLogSpecification { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecification) })] + System.Collections.Generic.List ServiceSpecificationLogSpecification { get; set; } /// Specifications of the Metrics for Azure Monitoring [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IMetricSpecification) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification[] ServiceSpecificationMetricSpecification { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IMetricSpecification) })] + System.Collections.Generic.List ServiceSpecificationMetricSpecification { get; set; } } /// Service REST API operation. @@ -221,9 +252,10 @@ internal partial interface IOperationDetailInternal /// /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ActionType? ActionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Internal")] + string ActionType { get; set; } /// Display of the operation - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplay Display { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplay Display { get; set; } /// Friendly description for the operation, string DisplayDescription { get; set; } /// Name of the operation @@ -242,13 +274,13 @@ internal partial interface IOperationDetailInternal /// Default value is 'user,system'. string Origin { get; set; } /// Properties of the operation - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationProperties Property { get; set; } /// Service specifications of the operation - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecification ServiceSpecification { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecification ServiceSpecification { get; set; } /// Specifications of the Log for Azure Monitoring - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification[] ServiceSpecificationLogSpecification { get; set; } + System.Collections.Generic.List ServiceSpecificationLogSpecification { get; set; } /// Specifications of the Metrics for Azure Monitoring - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification[] ServiceSpecificationMetricSpecification { get; set; } + System.Collections.Generic.List ServiceSpecificationMetricSpecification { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDetail.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDetail.json.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDetail.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDetail.json.cs index 33af33d12b54..499853ec32ff 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDetail.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDetail.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationDetail partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetail. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetail. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new OperationDetail(json) : null; } @@ -77,12 +77,12 @@ internal OperationDetail(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runti { return; } - {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.OperationDisplay.FromJson(__jsonDisplay) : Display;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.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;} - {_actionType = If( json?.PropertyT("actionType"), out var __jsonActionType) ? (string)__jsonActionType : (string)ActionType;} + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.OperationDisplay.FromJson(__jsonDisplay) : _display;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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;} + {_actionType = If( json?.PropertyT("actionType"), out var __jsonActionType) ? (string)__jsonActionType : (string)_actionType;} AfterFromJson(json); } @@ -107,19 +107,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T } AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._isDataAction ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonBoolean((bool)this._isDataAction) : null, "isDataAction" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._origin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._origin.ToString()) : null, "origin" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._actionType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._actionType.ToString()) : null, "actionType" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDisplay.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs similarity index 69% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDisplay.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs index bab92664f490..d3e0171636bd 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDisplay.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class OperationDisplay partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationDisplay(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,25 +111,25 @@ internal OperationDisplay(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,19 +144,19 @@ internal OperationDisplay(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -157,6 +165,18 @@ internal OperationDisplay(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 object that represents the operation. [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDisplay.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDisplay.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs index 628f1b0e1c99..dd294b5fe398 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDisplay.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IOperationDisplay ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplay ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplay).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplay).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDisplay.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDisplay.cs similarity index 87% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDisplay.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDisplay.cs index 19e3693c6c31..ef208fd0892d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDisplay.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The object that represents the operation. public partial class OperationDisplay : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplay, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IOperationDisplayInternal.Description { get => this._description; set { {_description = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal.Description { get => this._description; set { {_description = value;} } } /// Internal Acessors for Operation - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal.Operation { get => this._operation; set { {_operation = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal.Operation { get => this._operation; set { {_operation = value;} } } /// Internal Acessors for Provider - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal.Provider { get => this._provider; set { {_provider = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplayInternal.Provider { get => this._provider; set { {_provider = value;} } } /// Internal Acessors for Resource - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplayInternal.Resource { get => this._resource; set { {_resource = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Friendly description for the operation,", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -75,6 +78,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Name of the operation", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +89,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Service provider: Microsoft.HealthcareApis", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -91,6 +100,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource Type: Services", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDisplay.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDisplay.json.cs similarity index 95% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDisplay.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationDisplay.json.cs index b7220617aa1f..0025e209c9f0 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationDisplay.json.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationDisplay partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplay. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplay. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplay. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplay. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; } @@ -77,10 +77,10 @@ internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runt { 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.HealthcareApis.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationProperties.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationProperties.PowerShell.cs similarity index 61% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationProperties.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationProperties.PowerShell.cs index 82f2b394ad45..55865fa66151 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationProperties.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class OperationProperties partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IOperationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationProperties(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,21 +111,21 @@ internal OperationProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ServiceSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceSpecificationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceSpecificationTypeConverter.ConvertFrom); } if (content.Contains("ServiceSpecificationLogSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal)this).ServiceSpecificationLogSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification[]) content.GetValueForProperty("ServiceSpecificationLogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal)this).ServiceSpecificationLogSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.LogSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal)this).ServiceSpecificationLogSpecification = (System.Collections.Generic.List) content.GetValueForProperty("ServiceSpecificationLogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal)this).ServiceSpecificationLogSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.LogSpecificationTypeConverter.ConvertFrom)); } if (content.Contains("ServiceSpecificationMetricSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.MetricSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification = (System.Collections.Generic.List) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. @@ -132,15 +140,15 @@ internal OperationProperties(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("ServiceSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceSpecificationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceSpecificationTypeConverter.ConvertFrom); } if (content.Contains("ServiceSpecificationLogSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal)this).ServiceSpecificationLogSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification[]) content.GetValueForProperty("ServiceSpecificationLogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal)this).ServiceSpecificationLogSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.LogSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal)this).ServiceSpecificationLogSpecification = (System.Collections.Generic.List) content.GetValueForProperty("ServiceSpecificationLogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal)this).ServiceSpecificationLogSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.LogSpecificationTypeConverter.ConvertFrom)); } if (content.Contains("ServiceSpecificationMetricSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.MetricSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification = (System.Collections.Generic.List) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.MetricSpecificationTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -149,6 +157,18 @@ internal OperationProperties(global::System.Management.Automation.PSObject conte /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Extra Operation properties [System.ComponentModel.TypeConverter(typeof(OperationPropertiesTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationProperties.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationProperties.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationProperties.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationProperties.TypeConverter.cs index e36f0e035870..504f483748e8 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationProperties.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IOperationProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationProperties.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationProperties.cs similarity index 55% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationProperties.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationProperties.cs index 117768569b8a..0569079ce552 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationProperties.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Extra Operation properties public partial class OperationProperties : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationProperties, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationProperties, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal { /// Internal Acessors for ServiceSpecification - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecification Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationPropertiesInternal.ServiceSpecification { get => (this._serviceSpecification = this._serviceSpecification ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceSpecification()); set { {_serviceSpecification = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecification Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationPropertiesInternal.ServiceSpecification { get => (this._serviceSpecification = this._serviceSpecification ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceSpecification()); set { {_serviceSpecification = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecification _serviceSpecification; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecification _serviceSpecification; /// Service specifications of the operation [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecification ServiceSpecification { get => (this._serviceSpecification = this._serviceSpecification ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceSpecification()); set => this._serviceSpecification = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecification ServiceSpecification { get => (this._serviceSpecification = this._serviceSpecification ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceSpecification()); set => this._serviceSpecification = value; } /// Specifications of the Log for Azure Monitoring [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification[] ServiceSpecificationLogSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecificationInternal)ServiceSpecification).LogSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecificationInternal)ServiceSpecification).LogSpecification = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ServiceSpecificationLogSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecificationInternal)ServiceSpecification).LogSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecificationInternal)ServiceSpecification).LogSpecification = value ?? null /* arrayOf */; } /// Specifications of the Metrics for Azure Monitoring [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification[] ServiceSpecificationMetricSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecificationInternal)ServiceSpecification).MetricSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecificationInternal)ServiceSpecification).MetricSpecification = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ServiceSpecificationMetricSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecificationInternal)ServiceSpecification).MetricSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Models.Api20211101.ILogSpecification) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification[] ServiceSpecificationLogSpecification { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecification) })] + System.Collections.Generic.List ServiceSpecificationLogSpecification { get; set; } /// Specifications of the Metrics for Azure Monitoring [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IMetricSpecification) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification[] ServiceSpecificationMetricSpecification { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServiceSpecification ServiceSpecification { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecification ServiceSpecification { get; set; } /// Specifications of the Log for Azure Monitoring - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification[] ServiceSpecificationLogSpecification { get; set; } + System.Collections.Generic.List ServiceSpecificationLogSpecification { get; set; } /// Specifications of the Metrics for Azure Monitoring - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification[] ServiceSpecificationMetricSpecification { get; set; } + System.Collections.Generic.List ServiceSpecificationMetricSpecification { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationProperties.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationProperties.json.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationProperties.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationProperties.json.cs index e1efac43780d..34ecb292ba92 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationProperties.json.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new OperationProperties(json) : null; } @@ -77,7 +77,7 @@ internal OperationProperties(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.R { return; } - {_serviceSpecification = If( json?.PropertyT("serviceSpecification"), out var __jsonServiceSpecification) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceSpecification.FromJson(__jsonServiceSpecification) : ServiceSpecification;} + {_serviceSpecification = If( json?.PropertyT("serviceSpecification"), out var __jsonServiceSpecification) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceSpecification.FromJson(__jsonServiceSpecification) : _serviceSpecification;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationResultsDescription.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationResultsDescription.PowerShell.cs similarity index 63% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationResultsDescription.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationResultsDescription.PowerShell.cs index ec0dc6981531..738200c46b7d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationResultsDescription.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationResultsDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class OperationResultsDescription partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescription DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationResultsDescription(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.HealthcareApis.Models.Api20211101.IOperationResultsDescription DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationResultsDescription(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescription FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,33 +111,33 @@ internal OperationResultsDescription(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("StartTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).StartTime = (string) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).StartTime, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).StartTime = (string) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).StartTime, global::System.Convert.ToString); } if (content.Contains("EndTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).EndTime = (string) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).EndTime, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).EndTime = (string) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).EndTime, global::System.Convert.ToString); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IAny) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IAny) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. @@ -146,27 +152,27 @@ internal OperationResultsDescription(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("StartTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).StartTime = (string) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).StartTime, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).StartTime = (string) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).StartTime, global::System.Convert.ToString); } if (content.Contains("EndTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).EndTime = (string) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).EndTime, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).EndTime = (string) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).EndTime, global::System.Convert.ToString); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IAny) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IAny) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -175,6 +181,18 @@ internal OperationResultsDescription(global::System.Management.Automation.PSObje /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 indicating the operation result of an operation on a service. [System.ComponentModel.TypeConverter(typeof(OperationResultsDescriptionTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationResultsDescription.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationResultsDescription.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationResultsDescription.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationResultsDescription.TypeConverter.cs index 47a7ebc822d9..91fbd47c03e5 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationResultsDescription.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationResultsDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IOperationResultsDescription ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescription).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationResultsDescription.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationResultsDescription.cs similarity index 83% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationResultsDescription.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationResultsDescription.cs index fe8605fa054e..98f05a01a61d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationResultsDescription.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationResultsDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The properties indicating the operation result of an operation on a service. public partial class OperationResultsDescription : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescription, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal { /// Backing field for property. @@ -28,19 +28,19 @@ public partial class OperationResultsDescription : public string Id { get => this._id; } /// Internal Acessors for EndTime - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal.EndTime { get => this._endTime; set { {_endTime = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal.EndTime { get => this._endTime; set { {_endTime = value;} } } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for StartTime - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal.StartTime { get => this._startTime; set { {_startTime = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal.StartTime { get => this._startTime; set { {_startTime = value;} } } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatus? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescriptionInternal.Status { get => this._status; set { {_status = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescriptionInternal.Status { get => this._status; set { {_status = value;} } } /// Backing field for property. private string _name; @@ -68,11 +68,11 @@ public partial class OperationResultsDescription : public string StartTime { get => this._startTime; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatus? _status; + private string _status; /// The status of the operation being performed. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatus? Status { get => this._status; } + public string Status { get => this._status; } /// Creates an new instance. public OperationResultsDescription() @@ -88,6 +88,9 @@ public partial interface IOperationResultsDescription : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The time that the operation finished.", SerializedName = @"endTime", PossibleTypes = new [] { typeof(string) })] @@ -96,6 +99,9 @@ public partial interface IOperationResultsDescription : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The ID of the operation returned.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -104,6 +110,9 @@ public partial interface IOperationResultsDescription : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the operation result.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -112,6 +121,9 @@ public partial interface IOperationResultsDescription : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Additional properties of the operation result.", SerializedName = @"properties", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IAny) })] @@ -120,6 +132,9 @@ public partial interface IOperationResultsDescription : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The time that the operation was started.", SerializedName = @"startTime", PossibleTypes = new [] { typeof(string) })] @@ -128,10 +143,14 @@ public partial interface IOperationResultsDescription : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The status of the operation being performed.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatus? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Canceled", "Succeeded", "Failed", "Requested", "Running")] + string Status { get; } } /// The properties indicating the operation result of an operation on a service. @@ -149,7 +168,8 @@ internal partial interface IOperationResultsDescriptionInternal /// The time that the operation was started. string StartTime { get; set; } /// The status of the operation being performed. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Canceled", "Succeeded", "Failed", "Requested", "Running")] + string Status { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationResultsDescription.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationResultsDescription.json.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationResultsDescription.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationResultsDescription.json.cs index 35a36470ba01..95e6f6d58d43 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/OperationResultsDescription.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/OperationResultsDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationResultsDescription partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescription. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescription. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescription FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new OperationResultsDescription(json) : null; } @@ -77,12 +77,12 @@ internal OperationResultsDescription(Microsoft.Azure.PowerShell.Cmdlets.Healthca { 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;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? (string)__jsonStartTime : (string)StartTime;} - {_endTime = If( json?.PropertyT("endTime"), out var __jsonEndTime) ? (string)__jsonEndTime : (string)EndTime;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Any.FromJson(__jsonProperties) : Property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? (string)__jsonStartTime : (string)_startTime;} + {_endTime = If( json?.PropertyT("endTime"), out var __jsonEndTime) ? (string)__jsonEndTime : (string)_endTime;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Any.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } @@ -105,23 +105,23 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._startTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._startTime.ToString()) : null, "startTime" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._endTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._endTime.ToString()) : null, "endTime" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpoint.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpoint.PowerShell.cs similarity index 77% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpoint.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpoint.PowerShell.cs index ddc011176ec1..6ec213134481 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpoint.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpoint.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class PrivateEndpoint partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateEndpoint(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.HealthcareApis.Models.Api10.IPrivateEndpoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateEndpoint(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,13 +111,13 @@ internal PrivateEndpoint(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointInternal)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. @@ -124,7 +132,7 @@ internal PrivateEndpoint(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointInternal)this).Id, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -133,6 +141,18 @@ internal PrivateEndpoint(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 Private Endpoint resource. [System.ComponentModel.TypeConverter(typeof(PrivateEndpointTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpoint.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpoint.TypeConverter.cs similarity index 98% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpoint.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpoint.TypeConverter.cs index 5af2f5a4ac15..03d2ab0f9b4f 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpoint.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpoint.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api10.IPrivateEndpoint ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpoint.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpoint.cs similarity index 91% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpoint.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpoint.cs index ea84a56d520f..482b1929f8ff 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpoint.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpoint.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The Private Endpoint resource. public partial class PrivateEndpoint : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointInternal { /// Backing field for property. @@ -21,7 +21,7 @@ public partial class PrivateEndpoint : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointInternal.Id { get => this._id; set { {_id = value;} } } /// Creates an new instance. public PrivateEndpoint() @@ -37,6 +37,9 @@ public partial interface IPrivateEndpoint : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The ARM identifier for Private Endpoint", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpoint.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpoint.json.cs similarity index 95% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpoint.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpoint.json.cs index 4a62ee76cbab..b8d94361b64e 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpoint.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpoint.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateEndpoint partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new PrivateEndpoint(json) : null; } @@ -77,7 +77,7 @@ internal PrivateEndpoint(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runti { 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); } @@ -100,7 +100,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnection.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnection.PowerShell.cs similarity index 53% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnection.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnection.PowerShell.cs index 738fc5ab7c84..7adf38b8ea3c 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnection.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnection.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class PrivateEndpointConnection partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateEndpointConnection(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.HealthcareApis.Models.Api10.IPrivateEndpointConnection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateEndpointConnection(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,53 +111,53 @@ internal PrivateEndpointConnection(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("PrivateEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointTypeConverter.ConvertFrom); } if (content.Contains("PrivateLinkServiceConnectionState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("PrivateEndpointId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, 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. @@ -164,47 +172,47 @@ internal PrivateEndpointConnection(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("PrivateEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointTypeConverter.ConvertFrom); } if (content.Contains("PrivateLinkServiceConnectionState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("PrivateEndpointId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -213,6 +221,18 @@ internal PrivateEndpointConnection(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 Private Endpoint Connection resource. [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnection.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnection.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnection.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnection.TypeConverter.cs index 45cf236987ec..f7ce2c48ecfa 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnection.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnection.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api10.IPrivateEndpointConnection ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnection.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnection.cs similarity index 60% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnection.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnection.cs index ef66bf5779ff..bf849020141d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnection.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnection.cs @@ -3,92 +3,91 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The Private Endpoint Connection resource. public partial class PrivateEndpointConnection : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Resource(); /// /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__resource).Id; } /// Internal Acessors for PrivateEndpoint - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal.PrivateEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint = value; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal.PrivateEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint = value ?? null /* model class */; } /// Internal Acessors for PrivateEndpointId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId = value ?? null; } /// Internal Acessors for PrivateLinkServiceConnectionState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal.PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState = value; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal.PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState = value ?? null /* model class */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__resource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__resource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__resource).Type = value ?? null; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__resource).Name; } /// The ARM identifier for Private Endpoint [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; } + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; } /// /// A message indicating if changes on the service provider require any updates on the consumer. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired = value ?? null; } + public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired = value ?? null; } /// The reason for approval/rejection of the connection. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription = value ?? null; } + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription = value ?? null; } /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus)""); } + public string PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties _property; /// Resource properties. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionProperties()); set => this._property = value; } /// The provisioning state of the private endpoint connection resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public PrivateEndpointConnection() @@ -111,12 +110,15 @@ public PrivateEndpointConnection() /// The Private Endpoint Connection resource. public partial interface IPrivateEndpointConnection : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResource { /// The ARM identifier for Private Endpoint [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The ARM identifier for Private Endpoint", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -127,6 +129,9 @@ public partial interface IPrivateEndpointConnection : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A message indicating if changes on the service provider require any updates on the consumer.", SerializedName = @"actionsRequired", PossibleTypes = new [] { typeof(string) })] @@ -135,6 +140,9 @@ public partial interface IPrivateEndpointConnection : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The reason for approval/rejection of the connection.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -145,32 +153,40 @@ public partial interface IPrivateEndpointConnection : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + string PrivateLinkServiceConnectionStateStatus { get; set; } /// The provisioning state of the private endpoint connection resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state of the private endpoint connection resource.", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Succeeded", "Creating", "Deleting", "Failed")] + string ProvisioningState { get; } } /// The Private Endpoint Connection resource. internal partial interface IPrivateEndpointConnectionInternal : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal { /// The resource of private end point. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint PrivateEndpoint { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint PrivateEndpoint { get; set; } /// The ARM identifier for Private Endpoint string PrivateEndpointId { get; set; } /// /// A collection of information about the state of the connection between service consumer and provider. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } /// /// A message indicating if changes on the service provider require any updates on the consumer. /// @@ -180,11 +196,13 @@ internal partial interface IPrivateEndpointConnectionInternal : /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + string PrivateLinkServiceConnectionStateStatus { get; set; } /// Resource properties. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties Property { get; set; } /// The provisioning state of the private endpoint connection resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Succeeded", "Creating", "Deleting", "Failed")] + string ProvisioningState { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnection.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnection.json.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnection.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnection.json.cs index 0a0728cd0f5a..e54abdb9f4ca 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnection.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnection.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateEndpointConnection partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new PrivateEndpointConnection(json) : null; } @@ -77,8 +77,8 @@ internal PrivateEndpointConnection(Microsoft.Azure.PowerShell.Cmdlets.Healthcare { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionProperties.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionDescription.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionDescription.PowerShell.cs new file mode 100644 index 000000000000..b4469df0d821 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionDescription.PowerShell.cs @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + + /// The Private Endpoint Connection resource. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionDescriptionTypeConverter))] + public partial class PrivateEndpointConnectionDescription + { + + /// + /// 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.HealthcareApis.Models.IPrivateEndpointConnectionDescription DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateEndpointConnectionDescription(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.HealthcareApis.Models.IPrivateEndpointConnectionDescription DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateEndpointConnectionDescription(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.HealthcareApis.Models.IPrivateEndpointConnectionDescription FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateEndpointConnectionDescription(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, global::System.Convert.ToString); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateEndpointConnectionDescription(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, global::System.Convert.ToString); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + 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.HealthcareApis.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 Private Endpoint Connection resource. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionDescriptionTypeConverter))] + public partial interface IPrivateEndpointConnectionDescription + + { + + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionDescription.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionDescription.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionDescription.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionDescription.TypeConverter.cs index 42258b8541e0..1c2a3dc8a897 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionDescription.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionDescription.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionDescription.cs similarity index 50% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionDescription.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionDescription.cs index e9fa9e4422ef..2891d4815ca7 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionDescription.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionDescription.cs @@ -3,128 +3,155 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The Private Endpoint Connection resource. public partial class PrivateEndpointConnectionDescription : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection __privateEndpointConnection = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnection(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection __privateEndpointConnection = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnection(); /// /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__privateEndpointConnection).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__privateEndpointConnection).Id; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescriptionInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } + + /// Internal Acessors for PrivateEndpoint + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal.PrivateEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateEndpoint = value ?? null /* model class */; } /// Internal Acessors for PrivateEndpointId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateEndpointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateEndpointId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateEndpointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateEndpointId = value ?? null; } + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal.PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateLinkServiceConnectionState = value ?? null /* model class */; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal.Property { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).Property = value ?? null /* model class */; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)__privateEndpointConnection).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)__privateEndpointConnection).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).ProvisioningState = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__privateEndpointConnection).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__privateEndpointConnection).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__privateEndpointConnection).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__privateEndpointConnection).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__privateEndpointConnection).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__privateEndpointConnection).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__privateEndpointConnection).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__privateEndpointConnection).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__privateEndpointConnection).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__privateEndpointConnection).Type = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescriptionInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData()); set { {_systemData = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__privateEndpointConnection).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__privateEndpointConnection).Type = value ?? null; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__privateEndpointConnection).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__privateEndpointConnection).Name; } /// The resource of private end point. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint PrivateEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateEndpoint = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint PrivateEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateEndpoint = value ?? null /* model class */; } /// The ARM identifier for Private Endpoint [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateEndpointId; } + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateEndpointId; } /// /// A collection of information about the state of the connection between service consumer and provider. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateLinkServiceConnectionState = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateLinkServiceConnectionState = value ?? null /* model class */; } /// /// A message indicating if changes on the service provider require any updates on the consumer. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateLinkServiceConnectionStateActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateLinkServiceConnectionStateActionsRequired = value ?? null; } + public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateLinkServiceConnectionStateActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateLinkServiceConnectionStateActionsRequired = value ?? null; } /// The reason for approval/rejection of the connection. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateLinkServiceConnectionStateDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateLinkServiceConnectionStateDescription = value ?? null; } + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateLinkServiceConnectionStateDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateLinkServiceConnectionStateDescription = value ?? null; } /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateLinkServiceConnectionStateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateLinkServiceConnectionStateStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus)""); } + public string PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateLinkServiceConnectionStateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).PrivateLinkServiceConnectionStateStatus = value ?? null; } /// Resource properties. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionProperties Property { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)__privateEndpointConnection).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)__privateEndpointConnection).Property = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties Property { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).Property = value ?? null /* model class */; } /// The provisioning state of the private endpoint connection resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal)__privateEndpointConnection).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal)__privateEndpointConnection).ProvisioningState; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData _systemData; /// Metadata pertaining to creation and last modification of the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__privateEndpointConnection).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__privateEndpointConnection).Type; } /// Creates an new instance. public PrivateEndpointConnectionDescription() @@ -147,76 +174,98 @@ public PrivateEndpointConnectionDescription() /// The Private Endpoint Connection resource. public partial interface IPrivateEndpointConnectionDescription : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection { /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } + global::System.DateTime? SystemDataCreatedAt { get; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } + string SystemDataCreatedBy { get; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } + global::System.DateTime? SystemDataLastModifiedAt { get; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } + string SystemDataLastModifiedBy { get; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } } /// The Private Endpoint Connection resource. internal partial interface IPrivateEndpointConnectionDescriptionInternal : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionInternal { /// Metadata pertaining to creation and last modification of the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData SystemData { get; set; } /// The timestamp of resource creation (UTC). global::System.DateTime? SystemDataCreatedAt { get; set; } /// The identity that created the resource. string SystemDataCreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// The identity that last modified the resource. string SystemDataLastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionDescription.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionDescription.json.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionDescription.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionDescription.json.cs index 77a6c68560e4..a0d9727d3f5e 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionDescription.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateEndpointConnectionDescription partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionDescription(json) : null; } @@ -77,8 +77,8 @@ internal PrivateEndpointConnectionDescription(Microsoft.Azure.PowerShell.Cmdlets { return; } - __privateEndpointConnection = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnection(json); - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData.FromJson(__jsonSystemData) : SystemData;} + __privateEndpointConnection = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnection(json); + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} AfterFromJson(json); } @@ -103,7 +103,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T return container; } __privateEndpointConnection?.ToJson(container, serializationMode); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResult.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.PowerShell.cs similarity index 71% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResult.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.PowerShell.cs index 9646c5f2920e..68d36c37ab3b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResult.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -57,29 +57,37 @@ public partial class PrivateEndpointConnectionListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateEndpointConnectionListResult(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 . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateEndpointConnectionListResult(content); } @@ -91,10 +99,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. @@ -109,13 +117,13 @@ internal PrivateEndpointConnectionListResult(global::System.Collections.IDiction // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionTypeConverter.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. @@ -130,7 +138,7 @@ internal PrivateEndpointConnectionListResult(global::System.Management.Automatio // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -139,6 +147,18 @@ internal PrivateEndpointConnectionListResult(global::System.Management.Automatio /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 private endpoint connection associated with the specified storage account [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionListResultTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResult.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResult.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.TypeConverter.cs index fdb6dbd15975..3ae33aaf7a2b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResult.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResult.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.cs similarity index 71% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResult.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.cs index 9a1ff24c42ee..cc82cc87cf4f 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResult.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -11,16 +11,16 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 /// List of private endpoint connection associated with the specified storage account /// public partial class PrivateEndpointConnectionListResult : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResult, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResult, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] _value; + private System.Collections.Generic.List _value; /// Array of private endpoint connections [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public PrivateEndpointConnectionListResult() @@ -36,10 +36,13 @@ public partial interface IPrivateEndpointConnectionListResult : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of private endpoint connections", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection) })] + System.Collections.Generic.List Value { get; set; } } /// List of private endpoint connection associated with the specified storage account @@ -47,7 +50,7 @@ internal partial interface IPrivateEndpointConnectionListResultInternal { /// Array of private endpoint connections - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResult.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.json.cs similarity index 90% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResult.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.json.cs index 971f8da70c4f..789bccad4499 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResult.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class PrivateEndpointConnectionListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionListResult(json) : null; } @@ -79,7 +79,7 @@ internal PrivateEndpointConnectionListResult(Microsoft.Azure.PowerShell.Cmdlets. { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api10.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnection.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnection.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResultDescription.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResultDescription.PowerShell.cs similarity index 70% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResultDescription.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResultDescription.PowerShell.cs index 35e39250d848..346c77b35ec6 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResultDescription.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResultDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -57,29 +57,37 @@ public partial class PrivateEndpointConnectionListResultDescription partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultDescription DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultDescription DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateEndpointConnectionListResultDescription(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 . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultDescription DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultDescription DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateEndpointConnectionListResultDescription(content); } @@ -92,10 +100,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultDescription FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultDescription FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. @@ -110,13 +118,13 @@ internal PrivateEndpointConnectionListResultDescription(global::System.Collectio // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultDescriptionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultDescriptionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateEndpointConnectionDescriptionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultDescriptionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultDescriptionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionDescriptionTypeConverter.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. @@ -131,7 +139,7 @@ internal PrivateEndpointConnectionListResultDescription(global::System.Managemen // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultDescriptionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultDescriptionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateEndpointConnectionDescriptionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultDescriptionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultDescriptionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionDescriptionTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -140,6 +148,18 @@ internal PrivateEndpointConnectionListResultDescription(global::System.Managemen /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 private endpoint connection associated with the specified storage account [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionListResultDescriptionTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResultDescription.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResultDescription.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResultDescription.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResultDescription.TypeConverter.cs index 49e0bf0e5dad..3f72eac6d0d2 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResultDescription.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResultDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultDescription ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultDescription ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultDescription).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultDescription).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResultDescription.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResultDescription.cs similarity index 70% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResultDescription.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResultDescription.cs index de88b45ac045..5e92f20a1d4d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResultDescription.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResultDescription.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -11,16 +11,16 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 /// List of private endpoint connection associated with the specified storage account /// public partial class PrivateEndpointConnectionListResultDescription : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultDescription, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultDescriptionInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultDescription, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultDescriptionInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription[] _value; + private System.Collections.Generic.List _value; /// Array of private endpoint connections [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// /// Creates an new instance. @@ -38,10 +38,13 @@ public partial interface IPrivateEndpointConnectionListResultDescription : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of private endpoint connections", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription) })] + System.Collections.Generic.List Value { get; set; } } /// List of private endpoint connection associated with the specified storage account @@ -49,7 +52,7 @@ internal partial interface IPrivateEndpointConnectionListResultDescriptionIntern { /// Array of private endpoint connections - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResultDescription.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResultDescription.json.cs similarity index 89% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResultDescription.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResultDescription.json.cs index 81d57698d817..473144fdcd03 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateEndpointConnectionListResultDescription.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionListResultDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class PrivateEndpointConnectionListResultDescription partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultDescription. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultDescription. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultDescription. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultDescription. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultDescription FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultDescription FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionListResultDescription(json) : null; } @@ -80,7 +80,7 @@ internal PrivateEndpointConnectionListResultDescription(Microsoft.Azure.PowerShe { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateEndpointConnectionDescription.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IPrivateEndpointConnectionDescription) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionDescription.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnectionProperties.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.PowerShell.cs similarity index 56% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnectionProperties.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.PowerShell.cs index c7e5ba0bb3c3..99fcda34201d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnectionProperties.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class PrivateEndpointConnectionProperties partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateEndpointConnectionProperties(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 . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateEndpointConnectionProperties(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPr /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -107,37 +115,37 @@ internal PrivateEndpointConnectionProperties(global::System.Collections.IDiction // actually deserialize if (content.Contains("PrivateEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointTypeConverter.ConvertFrom); } if (content.Contains("PrivateLinkServiceConnectionState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("PrivateEndpointId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus, 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,31 +160,31 @@ internal PrivateEndpointConnectionProperties(global::System.Management.Automatio // actually deserialize if (content.Contains("PrivateEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointTypeConverter.ConvertFrom); } if (content.Contains("PrivateLinkServiceConnectionState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("PrivateEndpointId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -185,6 +193,18 @@ internal PrivateEndpointConnectionProperties(global::System.Management.Automatio /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 the PrivateEndpointConnectProperties. [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionPropertiesTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnectionProperties.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnectionProperties.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.TypeConverter.cs index eea0c2ea1261..f3f13bb6fd6a 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnectionProperties.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api10.IPrivateEndpointConnectionProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnectionProperties.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.cs similarity index 61% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnectionProperties.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.cs index fa27c644d83b..3fd1abf30b71 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnectionProperties.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.cs @@ -3,70 +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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Properties of the PrivateEndpointConnectProperties. public partial class PrivateEndpointConnectionProperties : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionProperties, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal { /// Internal Acessors for PrivateEndpoint - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpoint()); set { {_privateEndpoint = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpoint()); set { {_privateEndpoint = value;} } } /// Internal Acessors for PrivateEndpointId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointInternal)PrivateEndpoint).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointInternal)PrivateEndpoint).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointInternal)PrivateEndpoint).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointInternal)PrivateEndpoint).Id = value ?? null; } /// Internal Acessors for PrivateLinkServiceConnectionState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal.PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkServiceConnectionState()); set { {_privateLinkServiceConnectionState = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal.PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkServiceConnectionState()); set { {_privateLinkServiceConnectionState = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint _privateEndpoint; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint _privateEndpoint; /// The resource of private end point. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpoint()); set => this._privateEndpoint = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpoint()); set => this._privateEndpoint = value; } /// The ARM identifier for Private Endpoint [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointInternal)PrivateEndpoint).Id; } + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointInternal)PrivateEndpoint).Id; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState _privateLinkServiceConnectionState; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState _privateLinkServiceConnectionState; /// /// A collection of information about the state of the connection between service consumer and provider. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkServiceConnectionState()); set => this._privateLinkServiceConnectionState = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkServiceConnectionState()); set => this._privateLinkServiceConnectionState = value; } /// /// A message indicating if changes on the service provider require any updates on the consumer. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired = value ?? null; } + public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired = value ?? null; } /// The reason for approval/rejection of the connection. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description = value ?? null; } + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description = value ?? null; } /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus)""); } + public string PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state of the private endpoint connection resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Creates an new instance. public PrivateEndpointConnectionProperties() @@ -82,6 +82,9 @@ public partial interface IPrivateEndpointConnectionProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The ARM identifier for Private Endpoint", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -92,6 +95,9 @@ public partial interface IPrivateEndpointConnectionProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A message indicating if changes on the service provider require any updates on the consumer.", SerializedName = @"actionsRequired", PossibleTypes = new [] { typeof(string) })] @@ -100,6 +106,9 @@ public partial interface IPrivateEndpointConnectionProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The reason for approval/rejection of the connection.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -110,18 +119,26 @@ public partial interface IPrivateEndpointConnectionProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + string PrivateLinkServiceConnectionStateStatus { get; set; } /// The provisioning state of the private endpoint connection resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state of the private endpoint connection resource.", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Succeeded", "Creating", "Deleting", "Failed")] + string ProvisioningState { get; } } /// Properties of the PrivateEndpointConnectProperties. @@ -129,13 +146,13 @@ internal partial interface IPrivateEndpointConnectionPropertiesInternal { /// The resource of private end point. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpoint PrivateEndpoint { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpoint PrivateEndpoint { get; set; } /// The ARM identifier for Private Endpoint string PrivateEndpointId { get; set; } /// /// A collection of information about the state of the connection between service consumer and provider. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } /// /// A message indicating if changes on the service provider require any updates on the consumer. /// @@ -145,9 +162,11 @@ internal partial interface IPrivateEndpointConnectionPropertiesInternal /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + string PrivateLinkServiceConnectionStateStatus { get; set; } /// The provisioning state of the private endpoint connection resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Succeeded", "Creating", "Deleting", "Failed")] + string ProvisioningState { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnectionProperties.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.json.cs similarity index 92% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnectionProperties.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.json.cs index 3d3507f2ceea..49e32ed43701 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateEndpointConnectionProperties.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateEndpointConnectionProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnectionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionProperties(json) : null; } @@ -77,9 +77,9 @@ internal PrivateEndpointConnectionProperties(Microsoft.Azure.PowerShell.Cmdlets. { return; } - {_privateEndpoint = If( json?.PropertyT("privateEndpoint"), out var __jsonPrivateEndpoint) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpoint.FromJson(__jsonPrivateEndpoint) : PrivateEndpoint;} - {_privateLinkServiceConnectionState = If( json?.PropertyT("privateLinkServiceConnectionState"), out var __jsonPrivateLinkServiceConnectionState) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkServiceConnectionState.FromJson(__jsonPrivateLinkServiceConnectionState) : PrivateLinkServiceConnectionState;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_privateEndpoint = If( json?.PropertyT("privateEndpoint"), out var __jsonPrivateEndpoint) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpoint.FromJson(__jsonPrivateEndpoint) : _privateEndpoint;} + {_privateLinkServiceConnectionState = If( json?.PropertyT("privateLinkServiceConnectionState"), out var __jsonPrivateLinkServiceConnectionState) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkServiceConnectionState.FromJson(__jsonPrivateLinkServiceConnectionState) : _privateLinkServiceConnectionState;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} AfterFromJson(json); } @@ -105,7 +105,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T } AddIf( null != this._privateEndpoint ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._privateEndpoint.ToJson(null,serializationMode) : null, "privateEndpoint" ,container.Add ); AddIf( null != this._privateLinkServiceConnectionState ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._privateLinkServiceConnectionState.ToJson(null,serializationMode) : null, "privateLinkServiceConnectionState" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResource.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResource.PowerShell.cs similarity index 61% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResource.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResource.PowerShell.cs index a42685ac9f26..4e106d5da7c6 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResource.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResource.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class PrivateLinkResource partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateLinkResource(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.HealthcareApis.Models.Api10.IPrivateLinkResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateLinkResource(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,37 +111,37 @@ internal PrivateLinkResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkResourcePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourcePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("GroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); } if (content.Contains("RequiredMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).RequiredMember = (System.Collections.Generic.List) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("RequiredZoneName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).RequiredZoneName = (System.Collections.Generic.List) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).RequiredZoneName, __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. @@ -148,31 +156,31 @@ internal PrivateLinkResource(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkResourcePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourcePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("GroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); } if (content.Contains("RequiredMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).RequiredMember = (System.Collections.Generic.List) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("RequiredZoneName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).RequiredZoneName = (System.Collections.Generic.List) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -181,6 +189,18 @@ internal PrivateLinkResource(global::System.Management.Automation.PSObject conte /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 link resource [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourceTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResource.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResource.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResource.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResource.TypeConverter.cs index cb8f87e6f6da..973a0e6642fd 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResource.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResource.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api10.IPrivateLinkResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResource.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResource.cs similarity index 63% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResource.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResource.cs index fea168971a6c..21e7ed0da060 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResource.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResource.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// A private link resource public partial class PrivateLinkResource : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResource, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResource, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Resource(); /// The private link resource group id. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)Property).GroupId; } + public string GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)Property).GroupId; } /// /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__resource).Id; } /// Internal Acessors for GroupId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal.GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)Property).GroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)Property).GroupId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal.GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)Property).GroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)Property).GroupId = value ?? null; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkResourceProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourceProperties()); set { {_property = value;} } } /// Internal Acessors for RequiredMember - string[] Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal.RequiredMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal.RequiredMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember = value ?? null /* arrayOf */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__resource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__resource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__resource).Type = value ?? null; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__resource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties _property; /// Resource properties. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkResourceProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourceProperties()); set => this._property = value; } /// The private link resource required member names. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string[] RequiredMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember; } + public System.Collections.Generic.List RequiredMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember; } /// The private link resource Private link DNS zone name. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string[] RequiredZoneName { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)Property).RequiredZoneName; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)Property).RequiredZoneName = value ?? null /* arrayOf */; } + public System.Collections.Generic.List RequiredZoneName { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)Property).RequiredZoneName; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)Property).RequiredZoneName = value ?? null /* arrayOf */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public PrivateLinkResource() @@ -93,12 +92,15 @@ public PrivateLinkResource() /// A private link resource public partial interface IPrivateLinkResource : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResource { /// The private link resource group id. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The private link resource group id.", SerializedName = @"groupId", PossibleTypes = new [] { typeof(string) })] @@ -107,32 +109,38 @@ public partial interface IPrivateLinkResource : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The private link resource required member names.", SerializedName = @"requiredMembers", PossibleTypes = new [] { typeof(string) })] - string[] RequiredMember { get; } + System.Collections.Generic.List RequiredMember { get; } /// The private link resource Private link DNS zone name. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The private link resource Private link DNS zone name.", SerializedName = @"requiredZoneNames", PossibleTypes = new [] { typeof(string) })] - string[] RequiredZoneName { get; set; } + System.Collections.Generic.List RequiredZoneName { get; set; } } /// A private link resource internal partial interface IPrivateLinkResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal { /// The private link resource group id. string GroupId { get; set; } /// Resource properties. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties Property { get; set; } /// The private link resource required member names. - string[] RequiredMember { get; set; } + System.Collections.Generic.List RequiredMember { get; set; } /// The private link resource Private link DNS zone name. - string[] RequiredZoneName { get; set; } + System.Collections.Generic.List RequiredZoneName { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResource.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResource.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResource.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResource.json.cs index 551059250f2b..293df383da78 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResource.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResource.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateLinkResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new PrivateLinkResource(json) : null; } @@ -77,8 +77,8 @@ internal PrivateLinkResource(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.R { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkResourceProperties.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourceProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceDescription.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceDescription.PowerShell.cs similarity index 50% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceDescription.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceDescription.PowerShell.cs index b65cde2facd5..2d6ce09263a7 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceDescription.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class PrivateLinkResourceDescription partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateLinkResourceDescription(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.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateLinkResourceDescription(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,65 +111,65 @@ internal PrivateLinkResourceDescription(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("GroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); } if (content.Contains("RequiredMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).RequiredMember = (System.Collections.Generic.List) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("RequiredZoneName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).RequiredZoneName = (System.Collections.Generic.List) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkResourcePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourcePropertiesTypeConverter.ConvertFrom); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -178,59 +184,59 @@ internal PrivateLinkResourceDescription(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("GroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); } if (content.Contains("RequiredMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).RequiredMember = (System.Collections.Generic.List) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("RequiredZoneName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).RequiredZoneName = (System.Collections.Generic.List) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkResourcePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourcePropertiesTypeConverter.ConvertFrom); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } @@ -239,6 +245,18 @@ internal PrivateLinkResourceDescription(global::System.Management.Automation.PSO /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 Private Endpoint Connection resource. [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourceDescriptionTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceDescription.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceDescription.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceDescription.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceDescription.TypeConverter.cs index b684866d0a13..078502c8d8b7 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceDescription.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceDescription.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceDescription.cs similarity index 53% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceDescription.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceDescription.cs index ed966b03b2e8..6d738ba58bd9 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceDescription.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceDescription.cs @@ -3,106 +3,127 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The Private Endpoint Connection resource. public partial class PrivateLinkResourceDescription : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResource __privateLinkResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkResource(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResource __privateLinkResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResource(); /// The private link resource group id. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)__privateLinkResource).GroupId; } + public string GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)__privateLinkResource).GroupId; } /// /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__privateLinkResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__privateLinkResource).Id; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescriptionInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } /// Internal Acessors for GroupId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal.GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)__privateLinkResource).GroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)__privateLinkResource).GroupId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal.GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)__privateLinkResource).GroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)__privateLinkResource).GroupId = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal.Property { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)__privateLinkResource).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)__privateLinkResource).Property = value ?? null /* model class */; } /// Internal Acessors for RequiredMember - string[] Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal.RequiredMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)__privateLinkResource).RequiredMember; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)__privateLinkResource).RequiredMember = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal.RequiredMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)__privateLinkResource).RequiredMember; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)__privateLinkResource).RequiredMember = value ?? null /* arrayOf */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__privateLinkResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__privateLinkResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__privateLinkResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__privateLinkResource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__privateLinkResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__privateLinkResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__privateLinkResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__privateLinkResource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__privateLinkResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__privateLinkResource).Type = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescriptionInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData()); set { {_systemData = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__privateLinkResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__privateLinkResource).Type = value ?? null; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__privateLinkResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__privateLinkResource).Name; } /// Resource properties. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceProperties Property { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)__privateLinkResource).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)__privateLinkResource).Property = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties Property { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)__privateLinkResource).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)__privateLinkResource).Property = value ?? null /* model class */; } /// The private link resource required member names. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string[] RequiredMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)__privateLinkResource).RequiredMember; } + public System.Collections.Generic.List RequiredMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)__privateLinkResource).RequiredMember; } /// The private link resource Private link DNS zone name. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string[] RequiredZoneName { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)__privateLinkResource).RequiredZoneName; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal)__privateLinkResource).RequiredZoneName = value ?? null /* arrayOf */; } + public System.Collections.Generic.List RequiredZoneName { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)__privateLinkResource).RequiredZoneName; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal)__privateLinkResource).RequiredZoneName = value ?? null /* arrayOf */; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData _systemData; /// Metadata pertaining to creation and last modification of the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)__privateLinkResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)__privateLinkResource).Type; } /// Creates an new instance. public PrivateLinkResourceDescription() @@ -125,76 +146,98 @@ public PrivateLinkResourceDescription() /// The Private Endpoint Connection resource. public partial interface IPrivateLinkResourceDescription : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResource { /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } + global::System.DateTime? SystemDataCreatedAt { get; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } + string SystemDataCreatedBy { get; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } + global::System.DateTime? SystemDataLastModifiedAt { get; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } + string SystemDataLastModifiedBy { get; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } } /// The Private Endpoint Connection resource. internal partial interface IPrivateLinkResourceDescriptionInternal : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceInternal { /// Metadata pertaining to creation and last modification of the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData SystemData { get; set; } /// The timestamp of resource creation (UTC). global::System.DateTime? SystemDataCreatedAt { get; set; } /// The identity that created the resource. string SystemDataCreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// The identity that last modified the resource. string SystemDataLastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceDescription.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceDescription.json.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceDescription.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceDescription.json.cs index 517c2a7231bf..d37c6b186deb 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceDescription.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateLinkResourceDescription partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new PrivateLinkResourceDescription(json) : null; } @@ -77,8 +77,8 @@ internal PrivateLinkResourceDescription(Microsoft.Azure.PowerShell.Cmdlets.Healt { return; } - __privateLinkResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateLinkResource(json); - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData.FromJson(__jsonSystemData) : SystemData;} + __privateLinkResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResource(json); + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} AfterFromJson(json); } @@ -102,7 +102,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T return container; } __privateLinkResource?.ToJson(container, serializationMode); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceListResultDescription.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceListResultDescription.PowerShell.cs similarity index 71% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceListResultDescription.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceListResultDescription.PowerShell.cs index dd64e1bbb71b..3e2d3b66b94f 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceListResultDescription.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceListResultDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class PrivateLinkResourceListResultDescription partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceListResultDescription DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceListResultDescription DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateLinkResourceListResultDescription(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 . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceListResultDescription DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceListResultDescription DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateLinkResourceListResultDescription(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceListResultDescription FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceListResultDescription FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. @@ -108,13 +116,13 @@ internal PrivateLinkResourceListResultDescription(global::System.Collections.IDi // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceListResultDescriptionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceListResultDescriptionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateLinkResourceDescriptionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceListResultDescriptionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceListResultDescriptionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourceDescriptionTypeConverter.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,7 +137,7 @@ internal PrivateLinkResourceListResultDescription(global::System.Management.Auto // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceListResultDescriptionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceListResultDescriptionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateLinkResourceDescriptionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceListResultDescriptionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceListResultDescriptionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourceDescriptionTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -138,6 +146,18 @@ internal PrivateLinkResourceListResultDescription(global::System.Management.Auto /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// A list of private link resources [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourceListResultDescriptionTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceListResultDescription.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceListResultDescription.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceListResultDescription.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceListResultDescription.TypeConverter.cs index 4f4d226653a0..6ba99068f275 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceListResultDescription.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceListResultDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IPrivateLinkResourceListResultDescription ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceListResultDescription ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceListResultDescription).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceListResultDescription).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceListResultDescription.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceListResultDescription.cs similarity index 69% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceListResultDescription.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceListResultDescription.cs index c831f9b3d6dd..ff457ca20f9a 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceListResultDescription.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceListResultDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// A list of private link resources public partial class PrivateLinkResourceListResultDescription : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceListResultDescription, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceListResultDescriptionInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceListResultDescription, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceListResultDescriptionInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription[] _value; + private System.Collections.Generic.List _value; /// Array of private link resources [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// /// Creates an new instance. @@ -36,10 +36,13 @@ public partial interface IPrivateLinkResourceListResultDescription : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Array of private link resources", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription) })] + System.Collections.Generic.List Value { get; set; } } /// A list of private link resources @@ -47,7 +50,7 @@ internal partial interface IPrivateLinkResourceListResultDescriptionInternal { /// Array of private link resources - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceListResultDescription.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceListResultDescription.json.cs similarity index 89% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceListResultDescription.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceListResultDescription.json.cs index b212a5333460..e76e6f2d5adb 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/PrivateLinkResourceListResultDescription.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceListResultDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateLinkResourceListResultDescription partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceListResultDescription. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceListResultDescription. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceListResultDescription. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceListResultDescription. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceListResultDescription FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceListResultDescription FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new PrivateLinkResourceListResultDescription(json) : null; } @@ -77,7 +77,7 @@ internal PrivateLinkResourceListResultDescription(Microsoft.Azure.PowerShell.Cmd { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateLinkResourceDescription.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IPrivateLinkResourceDescription) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateLinkResourceDescription.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResourceProperties.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceProperties.PowerShell.cs similarity index 67% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResourceProperties.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceProperties.PowerShell.cs index 6a32ad721c3b..b9a91f555958 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResourceProperties.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceProperties.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class PrivateLinkResourceProperties partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateLinkResourceProperties(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.HealthcareApis.Models.Api10.IPrivateLinkResourceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateLinkResourceProperties(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,21 +111,21 @@ internal PrivateLinkResourceProperties(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("GroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)this).GroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)this).GroupId, global::System.Convert.ToString); } if (content.Contains("RequiredMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)this).RequiredMember = (System.Collections.Generic.List) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("RequiredZoneName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName = (System.Collections.Generic.List) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName, __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. @@ -134,15 +140,15 @@ internal PrivateLinkResourceProperties(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("GroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)this).GroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)this).GroupId, global::System.Convert.ToString); } if (content.Contains("RequiredMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)this).RequiredMember = (System.Collections.Generic.List) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("RequiredZoneName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName = (System.Collections.Generic.List) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -151,6 +157,18 @@ internal PrivateLinkResourceProperties(global::System.Management.Automation.PSOb /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 private link resource. [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourcePropertiesTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResourceProperties.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceProperties.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResourceProperties.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceProperties.TypeConverter.cs index 506af94ef8b0..3b20c9e0d8c3 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResourceProperties.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceProperties.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api10.IPrivateLinkResourceProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResourceProperties.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceProperties.cs similarity index 74% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResourceProperties.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceProperties.cs index 8165058e5117..2f913bc64f0f 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResourceProperties.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceProperties.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Properties of a private link resource. public partial class PrivateLinkResourceProperties : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceProperties, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal { /// Backing field for property. @@ -21,24 +21,24 @@ public partial class PrivateLinkResourceProperties : public string GroupId { get => this._groupId; } /// Internal Acessors for GroupId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal.GroupId { get => this._groupId; set { {_groupId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal.GroupId { get => this._groupId; set { {_groupId = value;} } } /// Internal Acessors for RequiredMember - string[] Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourcePropertiesInternal.RequiredMember { get => this._requiredMember; set { {_requiredMember = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourcePropertiesInternal.RequiredMember { get => this._requiredMember; set { {_requiredMember = value;} } } /// Backing field for property. - private string[] _requiredMember; + private System.Collections.Generic.List _requiredMember; /// The private link resource required member names. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public string[] RequiredMember { get => this._requiredMember; } + public System.Collections.Generic.List RequiredMember { get => this._requiredMember; } /// Backing field for property. - private string[] _requiredZoneName; + private System.Collections.Generic.List _requiredZoneName; /// The private link resource Private link DNS zone name. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public string[] RequiredZoneName { get => this._requiredZoneName; set => this._requiredZoneName = value; } + public System.Collections.Generic.List RequiredZoneName { get => this._requiredZoneName; set => this._requiredZoneName = value; } /// Creates an new instance. public PrivateLinkResourceProperties() @@ -54,6 +54,9 @@ public partial interface IPrivateLinkResourceProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The private link resource group id.", SerializedName = @"groupId", PossibleTypes = new [] { typeof(string) })] @@ -62,18 +65,24 @@ public partial interface IPrivateLinkResourceProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The private link resource required member names.", SerializedName = @"requiredMembers", PossibleTypes = new [] { typeof(string) })] - string[] RequiredMember { get; } + System.Collections.Generic.List RequiredMember { get; } /// The private link resource Private link DNS zone name. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The private link resource Private link DNS zone name.", SerializedName = @"requiredZoneNames", PossibleTypes = new [] { typeof(string) })] - string[] RequiredZoneName { get; set; } + System.Collections.Generic.List RequiredZoneName { get; set; } } /// Properties of a private link resource. @@ -83,9 +92,9 @@ internal partial interface IPrivateLinkResourcePropertiesInternal /// The private link resource group id. string GroupId { get; set; } /// The private link resource required member names. - string[] RequiredMember { get; set; } + System.Collections.Generic.List RequiredMember { get; set; } /// The private link resource Private link DNS zone name. - string[] RequiredZoneName { get; set; } + System.Collections.Generic.List RequiredZoneName { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResourceProperties.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceProperties.json.cs similarity index 90% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResourceProperties.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceProperties.json.cs index c9c53eca78a9..ddc749ffb252 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkResourceProperties.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkResourceProperties.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateLinkResourceProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkResourceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new PrivateLinkResourceProperties(json) : null; } @@ -77,9 +77,9 @@ internal PrivateLinkResourceProperties(Microsoft.Azure.PowerShell.Cmdlets.Health { return; } - {_groupId = If( json?.PropertyT("groupId"), out var __jsonGroupId) ? (string)__jsonGroupId : (string)GroupId;} - {_requiredMember = If( json?.PropertyT("requiredMembers"), out var __jsonRequiredMembers) ? If( __jsonRequiredMembers as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : RequiredMember;} - {_requiredZoneName = If( json?.PropertyT("requiredZoneNames"), out var __jsonRequiredZoneNames) ? If( __jsonRequiredZoneNames as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : RequiredZoneName;} + {_groupId = If( json?.PropertyT("groupId"), out var __jsonGroupId) ? (string)__jsonGroupId : (string)_groupId;} + {_requiredMember = If( json?.PropertyT("requiredMembers"), out var __jsonRequiredMembers) ? If( __jsonRequiredMembers as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _requiredMember;} + {_requiredZoneName = If( json?.PropertyT("requiredZoneNames"), out var __jsonRequiredZoneNames) ? If( __jsonRequiredZoneNames as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _requiredZoneName;} AfterFromJson(json); } @@ -102,11 +102,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._groupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._groupId.ToString()) : null, "groupId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { if (null != this._requiredMember) { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkServiceConnectionState.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.PowerShell.cs similarity index 70% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkServiceConnectionState.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.PowerShell.cs index aaa3580abc7d..3c7064c1102a 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkServiceConnectionState.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -57,29 +57,37 @@ public partial class PrivateLinkServiceConnectionState partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateLinkServiceConnectionState(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 . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateLinkServiceConnectionState(content); } @@ -91,10 +99,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPr /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. @@ -109,21 +117,21 @@ internal PrivateLinkServiceConnectionState(global::System.Collections.IDictionar // actually deserialize if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("ActionsRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired = (string) content.GetValueForProperty("ActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired = (string) content.GetValueForProperty("ActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -138,15 +146,15 @@ internal PrivateLinkServiceConnectionState(global::System.Management.Automation. // actually deserialize if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("ActionsRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired = (string) content.GetValueForProperty("ActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired = (string) content.GetValueForProperty("ActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -155,6 +163,18 @@ internal PrivateLinkServiceConnectionState(global::System.Management.Automation. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 collection of information about the state of the connection between service consumer and provider. [System.ComponentModel.TypeConverter(typeof(PrivateLinkServiceConnectionStateTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkServiceConnectionState.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkServiceConnectionState.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.TypeConverter.cs index 87f5da27a56e..a641a0e1d5cc 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkServiceConnectionState.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkServiceConnectionState.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.cs similarity index 85% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkServiceConnectionState.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.cs index 456eeb9ba9e3..7138ef06dde5 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkServiceConnectionState.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10 /// A collection of information about the state of the connection between service consumer and provider. /// public partial class PrivateLinkServiceConnectionState : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionStateInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionStateInternal { /// Backing field for property. @@ -32,13 +32,13 @@ public partial class PrivateLinkServiceConnectionState : public string Description { get => this._description; set => this._description = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus? _status; + private string _status; /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// Creates an new instance. public PrivateLinkServiceConnectionState() @@ -56,6 +56,9 @@ public partial interface IPrivateLinkServiceConnectionState : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A message indicating if changes on the service provider require any updates on the consumer.", SerializedName = @"actionsRequired", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +67,9 @@ public partial interface IPrivateLinkServiceConnectionState : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The reason for approval/rejection of the connection.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -74,10 +80,14 @@ public partial interface IPrivateLinkServiceConnectionState : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + string Status { get; set; } } /// A collection of information about the state of the connection between service consumer and provider. @@ -93,7 +103,8 @@ internal partial interface IPrivateLinkServiceConnectionStateInternal /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + string Status { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkServiceConnectionState.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkServiceConnectionState.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.json.cs index a1e094798351..31624aee1ffe 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/PrivateLinkServiceConnectionState.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class PrivateLinkServiceConnectionState partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateLinkServiceConnectionState FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkServiceConnectionState FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new PrivateLinkServiceConnectionState(json) : null; } @@ -79,9 +79,9 @@ internal PrivateLinkServiceConnectionState(Microsoft.Azure.PowerShell.Cmdlets.He { return; } - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_actionsRequired = If( json?.PropertyT("actionsRequired"), out var __jsonActionsRequired) ? (string)__jsonActionsRequired : (string)ActionsRequired;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_actionsRequired = If( json?.PropertyT("actionsRequired"), out var __jsonActionsRequired) ? (string)__jsonActionsRequired : (string)_actionsRequired;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/Resource.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Resource.PowerShell.cs similarity index 73% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/Resource.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Resource.PowerShell.cs index 807d79711658..6878b1a0340d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/Resource.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -57,27 +57,35 @@ public partial class Resource partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api10.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Resource(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IRe /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,21 +113,21 @@ internal Resource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. @@ -134,15 +142,15 @@ internal Resource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,6 +159,18 @@ internal Resource(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Common fields that are returned in the response for all Azure Resource Manager resources [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/Resource.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Resource.TypeConverter.cs similarity index 98% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/Resource.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Resource.TypeConverter.cs index 6be2988e9e7e..d3e07914fe74 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/Resource.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api10.IResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/Resource.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Resource.cs similarity index 91% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/Resource.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Resource.cs index ef7a9ee39756..21224285e7fc 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/Resource.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Resource.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10 /// Common fields that are returned in the response for all Azure Resource Manager resources /// public partial class Resource : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResource, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResource, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal { /// Backing field for property. @@ -25,13 +25,13 @@ public partial class Resource : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -65,6 +65,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -73,6 +76,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the resource", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +89,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of the resource. E.g. ""Microsoft.Compute/virtualMachines"" or ""Microsoft.Storage/storageAccounts""", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/Resource.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Resource.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/Resource.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Resource.json.cs index 324b1aef5819..0ff5b1e519ce 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/Resource.json.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class Resource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new Resource(json) : null; } @@ -79,9 +79,9 @@ internal Resource(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json { 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); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceCore.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceCore.PowerShell.cs similarity index 70% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceCore.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceCore.PowerShell.cs index 5c9e0aa074c1..e1bade6bbb27 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceCore.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceCore.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class ResourceCore partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCore DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCore DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ResourceCore(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.HealthcareApis.Models.Api20211101.IResourceCore DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCore DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ResourceCore(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCore FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCore FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,25 +111,25 @@ internal ResourceCore(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,19 +144,19 @@ internal ResourceCore(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -157,6 +165,18 @@ internal ResourceCore(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 common properties for any resource, tracked or proxy. [System.ComponentModel.TypeConverter(typeof(ResourceCoreTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceCore.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceCore.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceCore.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceCore.TypeConverter.cs index a5db3e9bd875..6174b6e59b62 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceCore.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceCore.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IResourceCore ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCore ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCore).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCore).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceCore.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceCore.cs similarity index 90% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceCore.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceCore.cs index fd3e75840c4c..01d25940d3c9 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceCore.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceCore.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The common properties for any resource, tracked or proxy. public partial class ResourceCore : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCore, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCore, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal { /// Backing field for property. @@ -30,13 +30,13 @@ public partial class ResourceCore : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -68,6 +68,9 @@ public partial interface IResourceCore : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", SerializedName = @"etag", PossibleTypes = new [] { typeof(string) })] @@ -76,6 +79,9 @@ public partial interface IResourceCore : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The resource identifier.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -84,6 +90,9 @@ public partial interface IResourceCore : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The resource name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -92,6 +101,9 @@ public partial interface IResourceCore : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The resource type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceCore.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceCore.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceCore.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceCore.json.cs index e28c81997fb8..89e4ca67d940 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceCore.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceCore.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ResourceCore partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCore. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCore. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCore. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCore. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCore FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCore FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ResourceCore(json) : null; } @@ -77,10 +77,10 @@ internal ResourceCore(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime. { 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;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + {_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;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } @@ -103,15 +103,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags.PowerShell.cs similarity index 81% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags.PowerShell.cs index e17f8dfd2e32..18a85f1e5fb8 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class ResourceTags partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ResourceTags(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -107,7 +115,7 @@ internal 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. @@ -129,6 +137,18 @@ internal ResourceTags(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Resource tags. [System.ComponentModel.TypeConverter(typeof(ResourceTagsTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags.TypeConverter.cs index 19577e30126f..fe465483c8a6 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags.cs index 288ef06e2039..fdeb12b3bfcf 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Resource tags. public partial class ResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTagsInternal { /// Creates an new instance. diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags.dictionary.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags.dictionary.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags.dictionary.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags.dictionary.cs index 5b46236c96db..2a30a2bf42c5 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags.dictionary.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.ResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags.json.cs similarity index 96% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags.json.cs index d057a1998c1e..cfe950ae2a1e 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags.json.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ResourceTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ResourceTags(json) : null; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags1.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags1.PowerShell.cs similarity index 76% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags1.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags1.PowerShell.cs index 0c4234c02e1d..6198652674f2 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags1.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags1.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -57,27 +57,35 @@ public partial class ResourceTags1 partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1 DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1 DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ResourceTags1(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.HealthcareApis.Models.Api20211101.IResourceTags1 DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1 DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ResourceTags1(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1 FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1 FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,13 +113,13 @@ internal ResourceTags1(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -126,7 +134,7 @@ internal ResourceTags1(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -135,6 +143,18 @@ internal ResourceTags1(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 key value pairs that describe the resource. This will overwrite the existing tags. [System.ComponentModel.TypeConverter(typeof(ResourceTags1TypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags1.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags1.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags1.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags1.TypeConverter.cs index f50b1c0563c8..9d649fa0b16b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags1.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags1.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IResourceTags1 ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1 ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags1.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags1.cs similarity index 82% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags1.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags1.cs index b06b8f4d5633..b65a5ada62ed 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags1.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags1.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -11,16 +11,16 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 /// List of key value pairs that describe the resource. This will overwrite the existing tags. /// public partial class ResourceTags1 : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTags()); set => this._tag = value; } /// Creates an new instance. public ResourceTags1() @@ -36,10 +36,13 @@ public partial interface IResourceTags1 : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get; set; } } /// List of key value pairs that describe the resource. This will overwrite the existing tags. @@ -47,7 +50,7 @@ internal partial interface IResourceTags1Internal { /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags1.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags1.json.cs similarity index 95% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags1.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags1.json.cs index 93542da7930e..15d7bd13c288 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceTags1.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceTags1.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class ResourceTags1 partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1 FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1 FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ResourceTags1(json) : null; } @@ -79,7 +79,7 @@ internal ResourceTags1(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime { return; } - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTags.FromJson(__jsonTags) : Tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfiguration.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfiguration.PowerShell.cs similarity index 69% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfiguration.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfiguration.PowerShell.cs index d5539b8c663e..54f82c2074c2 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfiguration.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class ResourceVersionPolicyConfiguration partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ResourceVersionPolicyConfiguration(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 . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ResourceVersionPolicyConfiguration(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -107,17 +115,17 @@ internal ResourceVersionPolicyConfiguration(global::System.Collections.IDictiona // actually deserialize if (content.Contains("Default")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationInternal)this).Default = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy?) content.GetValueForProperty("Default",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationInternal)this).Default, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationInternal)this).Default = (string) content.GetValueForProperty("Default",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationInternal)this).Default, global::System.Convert.ToString); } if (content.Contains("ResourceTypeOverride")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationInternal)this).ResourceTypeOverride = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides) content.GetValueForProperty("ResourceTypeOverride",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationInternal)this).ResourceTypeOverride, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfigurationResourceTypeOverridesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationInternal)this).ResourceTypeOverride = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides) content.GetValueForProperty("ResourceTypeOverride",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationInternal)this).ResourceTypeOverride, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfigurationResourceTypeOverridesTypeConverter.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. @@ -132,11 +140,11 @@ internal ResourceVersionPolicyConfiguration(global::System.Management.Automation // actually deserialize if (content.Contains("Default")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationInternal)this).Default = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy?) content.GetValueForProperty("Default",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationInternal)this).Default, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationInternal)this).Default = (string) content.GetValueForProperty("Default",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationInternal)this).Default, global::System.Convert.ToString); } if (content.Contains("ResourceTypeOverride")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationInternal)this).ResourceTypeOverride = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides) content.GetValueForProperty("ResourceTypeOverride",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationInternal)this).ResourceTypeOverride, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfigurationResourceTypeOverridesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationInternal)this).ResourceTypeOverride = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides) content.GetValueForProperty("ResourceTypeOverride",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationInternal)this).ResourceTypeOverride, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfigurationResourceTypeOverridesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -145,6 +153,18 @@ internal ResourceVersionPolicyConfiguration(global::System.Management.Automation /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 settings for history tracking for FHIR resources. [System.ComponentModel.TypeConverter(typeof(ResourceVersionPolicyConfigurationTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfiguration.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfiguration.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfiguration.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfiguration.TypeConverter.cs index 5710b95f8c3d..c32fc58fa4d8 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfiguration.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfiguration.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfiguration.cs similarity index 67% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfiguration.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfiguration.cs index 6c4e73c126e9..cd36323fbac8 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfiguration.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The settings for history tracking for FHIR resources. public partial class ResourceVersionPolicyConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy? _default; + private string _default; /// The default value for tracking history across all resources. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy? Default { get => this._default; set => this._default = value; } + public string Default { get => this._default; set => this._default = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides _resourceTypeOverride; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides _resourceTypeOverride; /// A list of FHIR Resources and their version policy overrides. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceTypeOverride { get => (this._resourceTypeOverride = this._resourceTypeOverride ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfigurationResourceTypeOverrides()); set => this._resourceTypeOverride = value; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceTypeOverride { get => (this._resourceTypeOverride = this._resourceTypeOverride ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfigurationResourceTypeOverrides()); set => this._resourceTypeOverride = value; } /// Creates an new instance. public ResourceVersionPolicyConfiguration() @@ -41,18 +41,25 @@ public partial interface IResourceVersionPolicyConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The default value for tracking history across all resources.", SerializedName = @"default", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy? Default { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("no-version", "versioned", "versioned-update")] + string Default { get; set; } /// A list of FHIR Resources and their version policy overrides. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of FHIR Resources and their version policy overrides.", SerializedName = @"resourceTypeOverrides", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceTypeOverride { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceTypeOverride { get; set; } } /// The settings for history tracking for FHIR resources. @@ -60,9 +67,10 @@ internal partial interface IResourceVersionPolicyConfigurationInternal { /// The default value for tracking history across all resources. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy? Default { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("no-version", "versioned", "versioned-update")] + string Default { get; set; } /// A list of FHIR Resources and their version policy overrides. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceTypeOverride { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceTypeOverride { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfiguration.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfiguration.json.cs similarity index 92% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfiguration.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfiguration.json.cs index 259aded44c35..f6122d5bb240 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfiguration.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfiguration.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ResourceVersionPolicyConfiguration partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ResourceVersionPolicyConfiguration(json) : null; } @@ -77,8 +77,8 @@ internal ResourceVersionPolicyConfiguration(Microsoft.Azure.PowerShell.Cmdlets.H { return; } - {_default = If( json?.PropertyT("default"), out var __jsonDefault) ? (string)__jsonDefault : (string)Default;} - {_resourceTypeOverride = If( json?.PropertyT("resourceTypeOverrides"), out var __jsonResourceTypeOverrides) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfigurationResourceTypeOverrides.FromJson(__jsonResourceTypeOverrides) : ResourceTypeOverride;} + {_default = If( json?.PropertyT("default"), out var __jsonDefault) ? (string)__jsonDefault : (string)_default;} + {_resourceTypeOverride = If( json?.PropertyT("resourceTypeOverrides"), out var __jsonResourceTypeOverrides) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfigurationResourceTypeOverrides.FromJson(__jsonResourceTypeOverrides) : _resourceTypeOverride;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfigurationResourceTypeOverrides.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfigurationResourceTypeOverrides.PowerShell.cs similarity index 80% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfigurationResourceTypeOverrides.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfigurationResourceTypeOverrides.PowerShell.cs index 29ef95c1316c..161ec1454c0c 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfigurationResourceTypeOverrides.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfigurationResourceTypeOverrides.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class ResourceVersionPolicyConfigurationResourceTypeOverrides partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ResourceVersionPolicyConfigurationResourceTypeOverrides(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 . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ResourceVersionPolicyConfigurationResourceTypeOverrides(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. @@ -112,7 +120,7 @@ internal ResourceVersionPolicyConfigurationResourceTypeOverrides(global::System. } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,6 +142,18 @@ internal ResourceVersionPolicyConfigurationResourceTypeOverrides(global::System. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// A list of FHIR Resources and their version policy overrides. [System.ComponentModel.TypeConverter(typeof(ResourceVersionPolicyConfigurationResourceTypeOverridesTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfigurationResourceTypeOverrides.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfigurationResourceTypeOverrides.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfigurationResourceTypeOverrides.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfigurationResourceTypeOverrides.TypeConverter.cs index aed51c46e545..34165823136c 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfigurationResourceTypeOverrides.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfigurationResourceTypeOverrides.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there is no suitable /// conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfigurationResourceTypeOverrides.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfigurationResourceTypeOverrides.cs similarity index 84% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfigurationResourceTypeOverrides.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfigurationResourceTypeOverrides.cs index a25052a99001..b8d250859740 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfigurationResourceTypeOverrides.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfigurationResourceTypeOverrides.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// A list of FHIR Resources and their version policy overrides. public partial class ResourceVersionPolicyConfigurationResourceTypeOverrides : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverridesInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverridesInternal { /// @@ -24,7 +24,7 @@ public ResourceVersionPolicyConfigurationResourceTypeOverrides() /// A list of FHIR Resources and their version policy overrides. public partial interface IResourceVersionPolicyConfigurationResourceTypeOverrides : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray { } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfigurationResourceTypeOverrides.dictionary.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfigurationResourceTypeOverrides.dictionary.cs similarity index 54% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfigurationResourceTypeOverrides.dictionary.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfigurationResourceTypeOverrides.dictionary.cs index 4fb4a928214e..a7ae5d28e9b0 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfigurationResourceTypeOverrides.dictionary.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfigurationResourceTypeOverrides.dictionary.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; public partial class ResourceVersionPolicyConfigurationResourceTypeOverrides : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray { - protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); - global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } - int Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + int Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } /// /// - public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy value) => __additionalProperties.Add( key, value); + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); public void Clear() => __additionalProperties.Clear(); @@ -40,7 +40,7 @@ public void CopyFrom(global::System.Collections.IDictionary source) { if ((null != property.Key && null != property.Value)) { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); } } } @@ -55,7 +55,7 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) { if ((null != property.Key && null != property.Value)) { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); } } } @@ -66,10 +66,10 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// /// - public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy value) => __additionalProperties.TryGetValue( key, out value); + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceVersionPolicyConfigurationResourceTypeOverrides source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceVersionPolicyConfigurationResourceTypeOverrides source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfigurationResourceTypeOverrides.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfigurationResourceTypeOverrides.json.cs similarity index 90% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfigurationResourceTypeOverrides.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfigurationResourceTypeOverrides.json.cs index 05a19de73021..33e3037398a7 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ResourceVersionPolicyConfigurationResourceTypeOverrides.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ResourceVersionPolicyConfigurationResourceTypeOverrides.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ResourceVersionPolicyConfigurationResourceTypeOverrides partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ResourceVersionPolicyConfigurationResourceTypeOverrides(json) : null; } @@ -79,7 +79,7 @@ internal ResourceVersionPolicyConfigurationResourceTypeOverrides(Microsoft.Azure { return; } - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); AfterFromJson(json); } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T { return container; } - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray)this).AdditionalProperties, container); + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray)this).AdditionalProperties, container); AfterToJson(ref container); return container; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAccessPolicyEntry.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAccessPolicyEntry.PowerShell.cs similarity index 76% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAccessPolicyEntry.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAccessPolicyEntry.PowerShell.cs index 0e9ddbff88c2..3875a1a8c5d2 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAccessPolicyEntry.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAccessPolicyEntry.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ServiceAccessPolicyEntry partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntry DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServiceAccessPolicyEntry(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.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntry DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServiceAccessPolicyEntry(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntry FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,13 +111,13 @@ internal ServiceAccessPolicyEntry(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("ObjectId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntryInternal)this).ObjectId = (string) content.GetValueForProperty("ObjectId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntryInternal)this).ObjectId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntryInternal)this).ObjectId = (string) content.GetValueForProperty("ObjectId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntryInternal)this).ObjectId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -126,7 +132,7 @@ internal ServiceAccessPolicyEntry(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("ObjectId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntryInternal)this).ObjectId = (string) content.GetValueForProperty("ObjectId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntryInternal)this).ObjectId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntryInternal)this).ObjectId = (string) content.GetValueForProperty("ObjectId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntryInternal)this).ObjectId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -135,6 +141,18 @@ internal ServiceAccessPolicyEntry(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 access policy entry. [System.ComponentModel.TypeConverter(typeof(ServiceAccessPolicyEntryTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAccessPolicyEntry.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAccessPolicyEntry.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAccessPolicyEntry.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAccessPolicyEntry.TypeConverter.cs index 94d8a9618f99..64a22661eac2 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAccessPolicyEntry.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAccessPolicyEntry.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntry ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntry).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAccessPolicyEntry.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAccessPolicyEntry.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAccessPolicyEntry.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAccessPolicyEntry.cs index 00007e61ec64..e4c411ca5a91 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAccessPolicyEntry.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAccessPolicyEntry.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// An access policy entry. public partial class ServiceAccessPolicyEntry : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntryInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntry, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntryInternal { /// Backing field for property. @@ -38,6 +38,9 @@ public partial interface IServiceAccessPolicyEntry : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"An Azure AD object ID (User or Apps) that is allowed access to the FHIR service.", SerializedName = @"objectId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAccessPolicyEntry.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAccessPolicyEntry.json.cs similarity index 95% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAccessPolicyEntry.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAccessPolicyEntry.json.cs index f6d48f783bd8..98f14632702d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAccessPolicyEntry.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAccessPolicyEntry.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServiceAccessPolicyEntry partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntry. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntry. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntry FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServiceAccessPolicyEntry(json) : null; } @@ -77,7 +77,7 @@ internal ServiceAccessPolicyEntry(Microsoft.Azure.PowerShell.Cmdlets.HealthcareA { return; } - {_objectId = If( json?.PropertyT("objectId"), out var __jsonObjectId) ? (string)__jsonObjectId : (string)ObjectId;} + {_objectId = If( json?.PropertyT("objectId"), out var __jsonObjectId) ? (string)__jsonObjectId : (string)_objectId;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAcrConfigurationInfo.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAcrConfigurationInfo.PowerShell.cs similarity index 67% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAcrConfigurationInfo.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAcrConfigurationInfo.PowerShell.cs index 589d7b0e67ca..2283d8189ec2 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAcrConfigurationInfo.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAcrConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ServiceAcrConfigurationInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServiceAcrConfigurationInfo(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.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServiceAcrConfigurationInfo(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,17 +111,17 @@ internal ServiceAcrConfigurationInfo(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("LoginServer")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfoInternal)this).LoginServer = (string[]) content.GetValueForProperty("LoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfoInternal)this).LoginServer, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfoInternal)this).LoginServer = (System.Collections.Generic.List) content.GetValueForProperty("LoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfoInternal)this).LoginServer, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("OciArtifact")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfoInternal)this).OciArtifact = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]) content.GetValueForProperty("OciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfoInternal)this).OciArtifact, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfoInternal)this).OciArtifact = (System.Collections.Generic.List) content.GetValueForProperty("OciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfoInternal)this).OciArtifact, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceOciArtifactEntryTypeConverter.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. @@ -130,11 +136,11 @@ internal ServiceAcrConfigurationInfo(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("LoginServer")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfoInternal)this).LoginServer = (string[]) content.GetValueForProperty("LoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfoInternal)this).LoginServer, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfoInternal)this).LoginServer = (System.Collections.Generic.List) content.GetValueForProperty("LoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfoInternal)this).LoginServer, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("OciArtifact")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfoInternal)this).OciArtifact = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]) content.GetValueForProperty("OciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfoInternal)this).OciArtifact, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfoInternal)this).OciArtifact = (System.Collections.Generic.List) content.GetValueForProperty("OciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfoInternal)this).OciArtifact, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -143,6 +149,18 @@ internal ServiceAcrConfigurationInfo(global::System.Management.Automation.PSObje /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Azure container registry configuration information [System.ComponentModel.TypeConverter(typeof(ServiceAcrConfigurationInfoTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAcrConfigurationInfo.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAcrConfigurationInfo.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAcrConfigurationInfo.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAcrConfigurationInfo.TypeConverter.cs index 1535fdb8a691..acac53abdebd 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAcrConfigurationInfo.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAcrConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAcrConfigurationInfo.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAcrConfigurationInfo.cs similarity index 68% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAcrConfigurationInfo.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAcrConfigurationInfo.cs index 9587ce84a4ca..a07e5db7c1ad 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAcrConfigurationInfo.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAcrConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Azure container registry configuration information public partial class ServiceAcrConfigurationInfo : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfoInternal { /// Backing field for property. - private string[] _loginServer; + private System.Collections.Generic.List _loginServer; /// The list of the ACR login servers. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public string[] LoginServer { get => this._loginServer; set => this._loginServer = value; } + public System.Collections.Generic.List LoginServer { get => this._loginServer; set => this._loginServer = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] _ociArtifact; + private System.Collections.Generic.List _ociArtifact; /// The list of Open Container Initiative (OCI) artifacts. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] OciArtifact { get => this._ociArtifact; set => this._ociArtifact = value; } + public System.Collections.Generic.List OciArtifact { get => this._ociArtifact; set => this._ociArtifact = value; } /// Creates an new instance. public ServiceAcrConfigurationInfo() @@ -41,18 +41,24 @@ public partial interface IServiceAcrConfigurationInfo : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of the ACR login servers.", SerializedName = @"loginServers", PossibleTypes = new [] { typeof(string) })] - string[] LoginServer { get; set; } + System.Collections.Generic.List LoginServer { get; set; } /// The list of Open Container Initiative (OCI) artifacts. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Open Container Initiative (OCI) artifacts.", SerializedName = @"ociArtifacts", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] OciArtifact { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry) })] + System.Collections.Generic.List OciArtifact { get; set; } } /// Azure container registry configuration information @@ -60,9 +66,9 @@ internal partial interface IServiceAcrConfigurationInfoInternal { /// The list of the ACR login servers. - string[] LoginServer { get; set; } + System.Collections.Generic.List LoginServer { get; set; } /// The list of Open Container Initiative (OCI) artifacts. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] OciArtifact { get; set; } + System.Collections.Generic.List OciArtifact { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAcrConfigurationInfo.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAcrConfigurationInfo.json.cs similarity index 87% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAcrConfigurationInfo.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAcrConfigurationInfo.json.cs index 344653880c96..ba1fb416815c 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAcrConfigurationInfo.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAcrConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServiceAcrConfigurationInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServiceAcrConfigurationInfo(json) : null; } @@ -77,8 +77,8 @@ internal ServiceAcrConfigurationInfo(Microsoft.Azure.PowerShell.Cmdlets.Healthca { return; } - {_loginServer = If( json?.PropertyT("loginServers"), out var __jsonLoginServers) ? If( __jsonLoginServers as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : LoginServer;} - {_ociArtifact = If( json?.PropertyT("ociArtifacts"), out var __jsonOciArtifacts) ? If( __jsonOciArtifacts as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceOciArtifactEntry.FromJson(__p) )) ))() : null : OciArtifact;} + {_loginServer = If( json?.PropertyT("loginServers"), out var __jsonLoginServers) ? If( __jsonLoginServers as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _loginServer;} + {_ociArtifact = If( json?.PropertyT("ociArtifacts"), out var __jsonOciArtifacts) ? If( __jsonOciArtifacts as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IServiceOciArtifactEntry) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceOciArtifactEntry.FromJson(__p) )) ))() : null : _ociArtifact;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAuthenticationConfigurationInfo.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAuthenticationConfigurationInfo.PowerShell.cs similarity index 69% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAuthenticationConfigurationInfo.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAuthenticationConfigurationInfo.PowerShell.cs index c3512b0fb341..90c9a889337b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAuthenticationConfigurationInfo.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAuthenticationConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class ServiceAuthenticationConfigurationInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServiceAuthenticationConfigurationInfo(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 . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServiceAuthenticationConfigurationInfo(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. @@ -108,21 +116,21 @@ internal ServiceAuthenticationConfigurationInfo(global::System.Collections.IDict // actually deserialize if (content.Contains("Authority")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal)this).Authority = (string) content.GetValueForProperty("Authority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal)this).Authority, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal)this).Authority = (string) content.GetValueForProperty("Authority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal)this).Authority, global::System.Convert.ToString); } if (content.Contains("Audience")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal)this).Audience = (string) content.GetValueForProperty("Audience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal)this).Audience, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal)this).Audience = (string) content.GetValueForProperty("Audience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal)this).Audience, global::System.Convert.ToString); } if (content.Contains("SmartProxyEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal)this).SmartProxyEnabled = (bool?) content.GetValueForProperty("SmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal)this).SmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal)this).SmartProxyEnabled = (bool?) content.GetValueForProperty("SmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal)this).SmartProxyEnabled, (__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. @@ -137,15 +145,15 @@ internal ServiceAuthenticationConfigurationInfo(global::System.Management.Automa // actually deserialize if (content.Contains("Authority")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal)this).Authority = (string) content.GetValueForProperty("Authority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal)this).Authority, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal)this).Authority = (string) content.GetValueForProperty("Authority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal)this).Authority, global::System.Convert.ToString); } if (content.Contains("Audience")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal)this).Audience = (string) content.GetValueForProperty("Audience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal)this).Audience, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal)this).Audience = (string) content.GetValueForProperty("Audience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal)this).Audience, global::System.Convert.ToString); } if (content.Contains("SmartProxyEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal)this).SmartProxyEnabled = (bool?) content.GetValueForProperty("SmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal)this).SmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal)this).SmartProxyEnabled = (bool?) content.GetValueForProperty("SmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal)this).SmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -154,6 +162,18 @@ internal ServiceAuthenticationConfigurationInfo(global::System.Management.Automa /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Authentication configuration information [System.ComponentModel.TypeConverter(typeof(ServiceAuthenticationConfigurationInfoTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAuthenticationConfigurationInfo.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAuthenticationConfigurationInfo.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAuthenticationConfigurationInfo.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAuthenticationConfigurationInfo.TypeConverter.cs index 84c13f84899c..00a543d0f2ed 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAuthenticationConfigurationInfo.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAuthenticationConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAuthenticationConfigurationInfo.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAuthenticationConfigurationInfo.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAuthenticationConfigurationInfo.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAuthenticationConfigurationInfo.cs index a98cb60763fc..29c0450f63f1 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAuthenticationConfigurationInfo.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAuthenticationConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Authentication configuration information public partial class ServiceAuthenticationConfigurationInfo : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IServiceAuthenticationConfigurationInfo : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The audience url for the service", SerializedName = @"audience", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IServiceAuthenticationConfigurationInfo : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The authority url for the service", SerializedName = @"authority", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IServiceAuthenticationConfigurationInfo : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If the SMART on FHIR proxy is enabled", SerializedName = @"smartProxyEnabled", PossibleTypes = new [] { typeof(bool) })] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAuthenticationConfigurationInfo.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAuthenticationConfigurationInfo.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAuthenticationConfigurationInfo.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAuthenticationConfigurationInfo.json.cs index 75e15bda5820..9af3aa7772a5 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceAuthenticationConfigurationInfo.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceAuthenticationConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServiceAuthenticationConfigurationInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServiceAuthenticationConfigurationInfo(json) : null; } @@ -77,9 +77,9 @@ internal ServiceAuthenticationConfigurationInfo(Microsoft.Azure.PowerShell.Cmdle { return; } - {_authority = If( json?.PropertyT("authority"), out var __jsonAuthority) ? (string)__jsonAuthority : (string)Authority;} - {_audience = If( json?.PropertyT("audience"), out var __jsonAudience) ? (string)__jsonAudience : (string)Audience;} - {_smartProxyEnabled = If( json?.PropertyT("smartProxyEnabled"), out var __jsonSmartProxyEnabled) ? (bool?)__jsonSmartProxyEnabled : SmartProxyEnabled;} + {_authority = If( json?.PropertyT("authority"), out var __jsonAuthority) ? (string)__jsonAuthority : (string)_authority;} + {_audience = If( json?.PropertyT("audience"), out var __jsonAudience) ? (string)__jsonAudience : (string)_audience;} + {_smartProxyEnabled = If( json?.PropertyT("smartProxyEnabled"), out var __jsonSmartProxyEnabled) ? (bool?)__jsonSmartProxyEnabled : _smartProxyEnabled;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCorsConfigurationInfo.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCorsConfigurationInfo.PowerShell.cs similarity index 62% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCorsConfigurationInfo.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCorsConfigurationInfo.PowerShell.cs index 002ff365c077..4997a2f85cae 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCorsConfigurationInfo.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCorsConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ServiceCorsConfigurationInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServiceCorsConfigurationInfo(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.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServiceCorsConfigurationInfo(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,29 +111,29 @@ internal ServiceCorsConfigurationInfo(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("Origin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).Origin = (string[]) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).Origin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).Origin = (System.Collections.Generic.List) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).Origin, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Header")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).Header = (string[]) content.GetValueForProperty("Header",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).Header, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).Header = (System.Collections.Generic.List) content.GetValueForProperty("Header",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).Header, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Method")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).Method = (string[]) content.GetValueForProperty("Method",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).Method, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).Method = (System.Collections.Generic.List) content.GetValueForProperty("Method",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).Method, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("MaxAge")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).MaxAge = (int?) content.GetValueForProperty("MaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).MaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).MaxAge = (int?) content.GetValueForProperty("MaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).MaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("AllowCredentials")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).AllowCredentials = (bool?) content.GetValueForProperty("AllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).AllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).AllowCredentials = (bool?) content.GetValueForProperty("AllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).AllowCredentials, (__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. @@ -142,23 +148,23 @@ internal ServiceCorsConfigurationInfo(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("Origin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).Origin = (string[]) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).Origin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).Origin = (System.Collections.Generic.List) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).Origin, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Header")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).Header = (string[]) content.GetValueForProperty("Header",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).Header, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).Header = (System.Collections.Generic.List) content.GetValueForProperty("Header",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).Header, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Method")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).Method = (string[]) content.GetValueForProperty("Method",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).Method, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).Method = (System.Collections.Generic.List) content.GetValueForProperty("Method",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).Method, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("MaxAge")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).MaxAge = (int?) content.GetValueForProperty("MaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).MaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).MaxAge = (int?) content.GetValueForProperty("MaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).MaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("AllowCredentials")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).AllowCredentials = (bool?) content.GetValueForProperty("AllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)this).AllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).AllowCredentials = (bool?) content.GetValueForProperty("AllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)this).AllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } @@ -167,6 +173,18 @@ internal ServiceCorsConfigurationInfo(global::System.Management.Automation.PSObj /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 settings for the CORS configuration of the service instance. [System.ComponentModel.TypeConverter(typeof(ServiceCorsConfigurationInfoTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCorsConfigurationInfo.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCorsConfigurationInfo.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCorsConfigurationInfo.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCorsConfigurationInfo.TypeConverter.cs index c8df4085e796..20df9615ca7c 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCorsConfigurationInfo.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCorsConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCorsConfigurationInfo.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCorsConfigurationInfo.cs similarity index 79% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCorsConfigurationInfo.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCorsConfigurationInfo.cs index 73d55e34e694..45f34abbdc5b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCorsConfigurationInfo.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCorsConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The settings for the CORS configuration of the service instance. public partial class ServiceCorsConfigurationInfo : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class ServiceCorsConfigurationInfo : public bool? AllowCredentials { get => this._allowCredentials; set => this._allowCredentials = value; } /// Backing field for property. - private string[] _header; + private System.Collections.Generic.List _header; /// The headers to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public string[] Header { get => this._header; set => this._header = value; } + public System.Collections.Generic.List Header { get => this._header; set => this._header = value; } /// Backing field for property. private int? _maxAge; @@ -35,18 +35,18 @@ public partial class ServiceCorsConfigurationInfo : public int? MaxAge { get => this._maxAge; set => this._maxAge = value; } /// Backing field for property. - private string[] _method; + private System.Collections.Generic.List _method; /// The methods to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public string[] Method { get => this._method; set => this._method = value; } + public System.Collections.Generic.List Method { get => this._method; set => this._method = value; } /// Backing field for property. - private string[] _origin; + private System.Collections.Generic.List _origin; /// The origins to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public string[] Origin { get => this._origin; set => this._origin = value; } + public System.Collections.Generic.List Origin { get => this._origin; set => this._origin = value; } /// Creates an new instance. public ServiceCorsConfigurationInfo() @@ -62,6 +62,9 @@ public partial interface IServiceCorsConfigurationInfo : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If credentials are allowed via CORS.", SerializedName = @"allowCredentials", PossibleTypes = new [] { typeof(bool) })] @@ -70,14 +73,20 @@ public partial interface IServiceCorsConfigurationInfo : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The headers to be allowed via CORS.", SerializedName = @"headers", PossibleTypes = new [] { typeof(string) })] - string[] Header { get; set; } + System.Collections.Generic.List Header { get; set; } /// The max age to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The max age to be allowed via CORS.", SerializedName = @"maxAge", PossibleTypes = new [] { typeof(int) })] @@ -86,18 +95,24 @@ public partial interface IServiceCorsConfigurationInfo : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The methods to be allowed via CORS.", SerializedName = @"methods", PossibleTypes = new [] { typeof(string) })] - string[] Method { get; set; } + System.Collections.Generic.List Method { get; set; } /// The origins to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The origins to be allowed via CORS.", SerializedName = @"origins", PossibleTypes = new [] { typeof(string) })] - string[] Origin { get; set; } + System.Collections.Generic.List Origin { get; set; } } /// The settings for the CORS configuration of the service instance. @@ -107,13 +122,13 @@ internal partial interface IServiceCorsConfigurationInfoInternal /// If credentials are allowed via CORS. bool? AllowCredentials { get; set; } /// The headers to be allowed via CORS. - string[] Header { get; set; } + System.Collections.Generic.List Header { get; set; } /// The max age to be allowed via CORS. int? MaxAge { get; set; } /// The methods to be allowed via CORS. - string[] Method { get; set; } + System.Collections.Generic.List Method { get; set; } /// The origins to be allowed via CORS. - string[] Origin { get; set; } + System.Collections.Generic.List Origin { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCorsConfigurationInfo.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCorsConfigurationInfo.json.cs similarity index 87% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCorsConfigurationInfo.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCorsConfigurationInfo.json.cs index f2bb4dc904be..f75a8c824e94 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCorsConfigurationInfo.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCorsConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServiceCorsConfigurationInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServiceCorsConfigurationInfo(json) : null; } @@ -77,11 +77,11 @@ internal ServiceCorsConfigurationInfo(Microsoft.Azure.PowerShell.Cmdlets.Healthc { return; } - {_origin = If( json?.PropertyT("origins"), out var __jsonOrigins) ? If( __jsonOrigins as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Origin;} - {_header = If( json?.PropertyT("headers"), out var __jsonHeaders) ? If( __jsonHeaders as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : Header;} - {_method = If( json?.PropertyT("methods"), out var __jsonMethods) ? If( __jsonMethods as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : Method;} - {_maxAge = If( json?.PropertyT("maxAge"), out var __jsonMaxAge) ? (int?)__jsonMaxAge : MaxAge;} - {_allowCredentials = If( json?.PropertyT("allowCredentials"), out var __jsonAllowCredentials) ? (bool?)__jsonAllowCredentials : AllowCredentials;} + {_origin = If( json?.PropertyT("origins"), out var __jsonOrigins) ? If( __jsonOrigins as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _origin;} + {_header = If( json?.PropertyT("headers"), out var __jsonHeaders) ? If( __jsonHeaders as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _header;} + {_method = If( json?.PropertyT("methods"), out var __jsonMethods) ? If( __jsonMethods as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : _method;} + {_maxAge = If( json?.PropertyT("maxAge"), out var __jsonMaxAge) ? (int?)__jsonMaxAge : _maxAge;} + {_allowCredentials = If( json?.PropertyT("allowCredentials"), out var __jsonAllowCredentials) ? (bool?)__jsonAllowCredentials : _allowCredentials;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCosmosDbConfigurationInfo.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCosmosDbConfigurationInfo.PowerShell.cs similarity index 72% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCosmosDbConfigurationInfo.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCosmosDbConfigurationInfo.PowerShell.cs index 7127085397d8..a01157d7eb86 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCosmosDbConfigurationInfo.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCosmosDbConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class ServiceCosmosDbConfigurationInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServiceCosmosDbConfigurationInfo(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 . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServiceCosmosDbConfigurationInfo(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,17 +113,17 @@ internal ServiceCosmosDbConfigurationInfo(global::System.Collections.IDictionary // actually deserialize if (content.Contains("OfferThroughput")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfoInternal)this).OfferThroughput = (int?) content.GetValueForProperty("OfferThroughput",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfoInternal)this).OfferThroughput, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfoInternal)this).OfferThroughput = (int?) content.GetValueForProperty("OfferThroughput",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfoInternal)this).OfferThroughput, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("KeyVaultKeyUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfoInternal)this).KeyVaultKeyUri = (string) content.GetValueForProperty("KeyVaultKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfoInternal)this).KeyVaultKeyUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfoInternal)this).KeyVaultKeyUri = (string) content.GetValueForProperty("KeyVaultKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfoInternal)this).KeyVaultKeyUri, 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. @@ -130,11 +138,11 @@ internal ServiceCosmosDbConfigurationInfo(global::System.Management.Automation.P // actually deserialize if (content.Contains("OfferThroughput")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfoInternal)this).OfferThroughput = (int?) content.GetValueForProperty("OfferThroughput",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfoInternal)this).OfferThroughput, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfoInternal)this).OfferThroughput = (int?) content.GetValueForProperty("OfferThroughput",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfoInternal)this).OfferThroughput, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("KeyVaultKeyUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfoInternal)this).KeyVaultKeyUri = (string) content.GetValueForProperty("KeyVaultKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfoInternal)this).KeyVaultKeyUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfoInternal)this).KeyVaultKeyUri = (string) content.GetValueForProperty("KeyVaultKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfoInternal)this).KeyVaultKeyUri, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,6 +151,18 @@ internal ServiceCosmosDbConfigurationInfo(global::System.Management.Automation.P /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 settings for the Cosmos DB database backing the service. [System.ComponentModel.TypeConverter(typeof(ServiceCosmosDbConfigurationInfoTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCosmosDbConfigurationInfo.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCosmosDbConfigurationInfo.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCosmosDbConfigurationInfo.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCosmosDbConfigurationInfo.TypeConverter.cs index 648194726562..0c7dcfa1928d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCosmosDbConfigurationInfo.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCosmosDbConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCosmosDbConfigurationInfo.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCosmosDbConfigurationInfo.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCosmosDbConfigurationInfo.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCosmosDbConfigurationInfo.cs index 272d84f56b7a..9562bea196e9 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCosmosDbConfigurationInfo.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCosmosDbConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The settings for the Cosmos DB database backing the service. public partial class ServiceCosmosDbConfigurationInfo : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfoInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IServiceCosmosDbConfigurationInfo : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URI of the customer-managed key for the backing database.", SerializedName = @"keyVaultKeyUri", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface IServiceCosmosDbConfigurationInfo : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The provisioned throughput for the backing database.", SerializedName = @"offerThroughput", PossibleTypes = new [] { typeof(int) })] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCosmosDbConfigurationInfo.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCosmosDbConfigurationInfo.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCosmosDbConfigurationInfo.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCosmosDbConfigurationInfo.json.cs index c6ec37b1b7b8..01674ffbbb8c 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceCosmosDbConfigurationInfo.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceCosmosDbConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServiceCosmosDbConfigurationInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServiceCosmosDbConfigurationInfo(json) : null; } @@ -77,8 +77,8 @@ internal ServiceCosmosDbConfigurationInfo(Microsoft.Azure.PowerShell.Cmdlets.Hea { return; } - {_offerThroughput = If( json?.PropertyT("offerThroughput"), out var __jsonOfferThroughput) ? (int?)__jsonOfferThroughput : OfferThroughput;} - {_keyVaultKeyUri = If( json?.PropertyT("keyVaultKeyUri"), out var __jsonKeyVaultKeyUri) ? (string)__jsonKeyVaultKeyUri : (string)KeyVaultKeyUri;} + {_offerThroughput = If( json?.PropertyT("offerThroughput"), out var __jsonOfferThroughput) ? (int?)__jsonOfferThroughput : _offerThroughput;} + {_keyVaultKeyUri = If( json?.PropertyT("keyVaultKeyUri"), out var __jsonKeyVaultKeyUri) ? (string)__jsonKeyVaultKeyUri : (string)_keyVaultKeyUri;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceExportConfigurationInfo.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceExportConfigurationInfo.PowerShell.cs similarity index 76% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceExportConfigurationInfo.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceExportConfigurationInfo.PowerShell.cs index 3e50f94344a2..8781bce88012 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceExportConfigurationInfo.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceExportConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ServiceExportConfigurationInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServiceExportConfigurationInfo(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.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServiceExportConfigurationInfo(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,13 +111,13 @@ internal ServiceExportConfigurationInfo(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("StorageAccountName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfoInternal)this).StorageAccountName = (string) content.GetValueForProperty("StorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfoInternal)this).StorageAccountName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfoInternal)this).StorageAccountName = (string) content.GetValueForProperty("StorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfoInternal)this).StorageAccountName, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -126,7 +132,7 @@ internal ServiceExportConfigurationInfo(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("StorageAccountName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfoInternal)this).StorageAccountName = (string) content.GetValueForProperty("StorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfoInternal)this).StorageAccountName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfoInternal)this).StorageAccountName = (string) content.GetValueForProperty("StorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfoInternal)this).StorageAccountName, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -135,6 +141,18 @@ internal ServiceExportConfigurationInfo(global::System.Management.Automation.PSO /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Export operation configuration information [System.ComponentModel.TypeConverter(typeof(ServiceExportConfigurationInfoTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceExportConfigurationInfo.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceExportConfigurationInfo.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceExportConfigurationInfo.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceExportConfigurationInfo.TypeConverter.cs index 07ec5f7346b3..eb08a51786de 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceExportConfigurationInfo.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceExportConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceExportConfigurationInfo.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceExportConfigurationInfo.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceExportConfigurationInfo.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceExportConfigurationInfo.cs index 4e16f65ee838..3cdd24c8391a 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceExportConfigurationInfo.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceExportConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Export operation configuration information public partial class ServiceExportConfigurationInfo : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfoInternal { /// Backing field for property. @@ -34,6 +34,9 @@ public partial interface IServiceExportConfigurationInfo : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the default export storage account.", SerializedName = @"storageAccountName", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceExportConfigurationInfo.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceExportConfigurationInfo.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceExportConfigurationInfo.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceExportConfigurationInfo.json.cs index db43bf3ec9fc..c7fbfa957436 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceExportConfigurationInfo.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceExportConfigurationInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServiceExportConfigurationInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServiceExportConfigurationInfo(json) : null; } @@ -77,7 +77,7 @@ internal ServiceExportConfigurationInfo(Microsoft.Azure.PowerShell.Cmdlets.Healt { return; } - {_storageAccountName = If( json?.PropertyT("storageAccountName"), out var __jsonStorageAccountName) ? (string)__jsonStorageAccountName : (string)StorageAccountName;} + {_storageAccountName = If( json?.PropertyT("storageAccountName"), out var __jsonStorageAccountName) ? (string)__jsonStorageAccountName : (string)_storageAccountName;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentity.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity.PowerShell.cs similarity index 62% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentity.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity.PowerShell.cs index 34a9896a64c4..d78298693cc6 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentity.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ServiceManagedIdentity partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServiceManagedIdentity(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.HealthcareApis.Models.Api20211101.IServiceManagedIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServiceManagedIdentity(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,29 +111,29 @@ internal ServiceManagedIdentity(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Identity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGeneratedTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1TypeConverter.ConvertFrom); } if (content.Contains("IdentityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType, global::System.Convert.ToString); } if (content.Contains("IdentityPrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); } if (content.Contains("IdentityTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentitiesTypeConverter.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,23 +148,23 @@ internal ServiceManagedIdentity(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("Identity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGeneratedTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1TypeConverter.ConvertFrom); } if (content.Contains("IdentityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityType, global::System.Convert.ToString); } if (content.Contains("IdentityPrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityPrincipalId, global::System.Convert.ToString); } if (content.Contains("IdentityTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityTenantId, global::System.Convert.ToString); } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -167,6 +173,18 @@ internal ServiceManagedIdentity(global::System.Management.Automation.PSObject co /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Managed service identity (system assigned and/or user assigned identities) [System.ComponentModel.TypeConverter(typeof(ServiceManagedIdentityTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentity.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentity.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity.TypeConverter.cs index ed96aa53546d..af3b82afd67f 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentity.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServiceManagedIdentity ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity.cs similarity index 70% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentity.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity.cs index df0f0b5b60f2..4c93210ce61d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity.cs @@ -3,42 +3,42 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Managed service identity (system assigned and/or user assigned identities) public partial class ServiceManagedIdentity : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated _identity; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 _identity; /// /// Setting indicating whether the service has a managed identity associated with it. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGenerated()); set => this._identity = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1()); set => this._identity = value; } /// /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)Identity).PrincipalId; } + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)Identity).PrincipalId; } /// /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)Identity).TenantId; } + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)Identity).TenantId; } /// /// Type of identity being specified, currently SystemAssigned and None are allowed. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType)""); } + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)Identity).Type = value ?? null; } /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM @@ -46,16 +46,16 @@ public partial class ServiceManagedIdentity : /// The dictionary values can be empty objects ({}) in requests. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// Internal Acessors for Identity - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGenerated()); set { {_identity = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1()); set { {_identity = value;} } } /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)Identity).PrincipalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)Identity).PrincipalId = value ?? null; } /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)Identity).TenantId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentityInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)Identity).TenantId = value ?? null; } /// Creates an new instance. public ServiceManagedIdentity() @@ -73,6 +73,9 @@ public partial interface IServiceManagedIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +86,9 @@ public partial interface IServiceManagedIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -93,10 +99,14 @@ public partial interface IServiceManagedIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of identity being specified, currently SystemAssigned and None are allowed.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType? IdentityType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] + string IdentityType { get; set; } /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. @@ -105,10 +115,13 @@ public partial interface IServiceManagedIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } } /// Managed service identity (system assigned and/or user assigned identities) @@ -118,7 +131,7 @@ internal partial interface IServiceManagedIdentityInternal /// /// Setting indicating whether the service has a managed identity associated with it. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated Identity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 Identity { get; set; } /// /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. /// @@ -130,13 +143,14 @@ internal partial interface IServiceManagedIdentityInternal /// /// Type of identity being specified, currently SystemAssigned and None are allowed. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType? IdentityType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] + string IdentityType { get; set; } /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. /// The dictionary values can be empty objects ({}) in requests. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentity.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentity.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity.json.cs index f6d4b3590a0d..ce33d231da08 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentity.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServiceManagedIdentity partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServiceManagedIdentity(json) : null; } @@ -77,7 +77,7 @@ internal ServiceManagedIdentity(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApi { return; } - {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceManagedIdentityAutoGenerated.FromJson(__jsonIdentity) : Identity;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceManagedIdentity1.FromJson(__jsonIdentity) : _identity;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentityAutoGenerated.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity1.PowerShell.cs similarity index 60% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentityAutoGenerated.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity1.PowerShell.cs index f29e9be62b7a..b9cb5683eeaf 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentityAutoGenerated.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity1.PowerShell.cs @@ -3,15 +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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; /// /// Setting indicating whether the service has a managed identity associated with it. /// - [System.ComponentModel.TypeConverter(typeof(ServiceManagedIdentityAutoGeneratedTypeConverter))] - public partial class ServiceManagedIdentityAutoGenerated + [System.ComponentModel.TypeConverter(typeof(ServiceManagedIdentity1TypeConverter))] + public partial class ServiceManagedIdentity1 { /// @@ -57,48 +57,52 @@ public partial class ServiceManagedIdentityAutoGenerated partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new ServiceManagedIdentityAutoGenerated(content); + return new ServiceManagedIdentity1(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.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new ServiceManagedIdentityAutoGenerated(content); + return new ServiceManagedIdentity1(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// - /// an instance of the model class. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal ServiceManagedIdentityAutoGenerated(global::System.Collections.IDictionary content) + internal ServiceManagedIdentity1(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -109,29 +113,29 @@ internal ServiceManagedIdentityAutoGenerated(global::System.Collections.IDiction // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)this).Type, global::System.Convert.ToString); } if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("TenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)this).TenantId, global::System.Convert.ToString); } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentitiesTypeConverter.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. - internal ServiceManagedIdentityAutoGenerated(global::System.Management.Automation.PSObject content) + internal ServiceManagedIdentity1(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -142,19 +146,19 @@ internal ServiceManagedIdentityAutoGenerated(global::System.Management.Automatio // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)this).Type, global::System.Convert.ToString); } if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("TenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)this).TenantId, global::System.Convert.ToString); } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -163,10 +167,22 @@ internal ServiceManagedIdentityAutoGenerated(global::System.Management.Automatio /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Setting indicating whether the service has a managed identity associated with it. - [System.ComponentModel.TypeConverter(typeof(ServiceManagedIdentityAutoGeneratedTypeConverter))] - public partial interface IServiceManagedIdentityAutoGenerated + [System.ComponentModel.TypeConverter(typeof(ServiceManagedIdentity1TypeConverter))] + public partial interface IServiceManagedIdentity1 { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentityAutoGenerated.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity1.TypeConverter.cs similarity index 82% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentityAutoGenerated.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity1.TypeConverter.cs index 8734c2876da9..533020e670f6 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentityAutoGenerated.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity1.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ServiceManagedIdentityAutoGeneratedTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class ServiceManagedIdentity1TypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -26,14 +26,13 @@ public partial class ServiceManagedIdentityAutoGeneratedTypeConverter : global:: public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the + /// 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) { @@ -96,32 +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.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1).IsAssignableFrom(type)) { return sourceValue; } try { - return ServiceManagedIdentityAutoGenerated.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return ServiceManagedIdentity1.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -129,11 +127,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return ServiceManagedIdentityAutoGenerated.DeserializeFromPSObject(sourceValue); + return ServiceManagedIdentity1.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return ServiceManagedIdentityAutoGenerated.DeserializeFromDictionary(sourceValue); + return ServiceManagedIdentity1.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentityAutoGenerated.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity1.cs similarity index 79% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentityAutoGenerated.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity1.cs index 410738cb0fb2..17d597366fb6 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentityAutoGenerated.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity1.cs @@ -3,23 +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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// /// Setting indicating whether the service has a managed identity associated with it. /// - public partial class ServiceManagedIdentityAutoGenerated : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal + public partial class ServiceManagedIdentity1 : + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal { /// Internal Acessors for PrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } /// Internal Acessors for TenantId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGeneratedInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1Internal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } /// Backing field for property. private string _principalId; @@ -40,16 +40,16 @@ public partial class ServiceManagedIdentityAutoGenerated : public string TenantId { get => this._tenantId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType _type; + private string _type; /// /// Type of identity being specified, currently SystemAssigned and None are allowed. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities _userAssignedIdentity; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities _userAssignedIdentity; /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM @@ -57,16 +57,16 @@ public partial class ServiceManagedIdentityAutoGenerated : /// The dictionary values can be empty objects ({}) in requests. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } - /// Creates an new instance. - public ServiceManagedIdentityAutoGenerated() + /// Creates an new instance. + public ServiceManagedIdentity1() { } } /// Setting indicating whether the service has a managed identity associated with it. - public partial interface IServiceManagedIdentityAutoGenerated : + public partial interface IServiceManagedIdentity1 : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable { /// @@ -75,6 +75,9 @@ public partial interface IServiceManagedIdentityAutoGenerated : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -85,6 +88,9 @@ public partial interface IServiceManagedIdentityAutoGenerated : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -95,10 +101,14 @@ public partial interface IServiceManagedIdentityAutoGenerated : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of identity being specified, currently SystemAssigned and None are allowed.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] + string Type { get; set; } /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. @@ -107,14 +117,17 @@ public partial interface IServiceManagedIdentityAutoGenerated : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities UserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } } /// Setting indicating whether the service has a managed identity associated with it. - internal partial interface IServiceManagedIdentityAutoGeneratedInternal + internal partial interface IServiceManagedIdentity1Internal { /// @@ -128,13 +141,14 @@ internal partial interface IServiceManagedIdentityAutoGeneratedInternal /// /// Type of identity being specified, currently SystemAssigned and None are allowed. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] + string Type { get; set; } /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. /// The dictionary values can be empty objects ({}) in requests. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities UserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentityAutoGenerated.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity1.json.cs similarity index 88% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentityAutoGenerated.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity1.json.cs index dc4c3553046e..e60602b087d7 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceManagedIdentityAutoGenerated.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceManagedIdentity1.json.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// /// Setting indicating whether the service has a managed identity associated with it. /// - public partial class ServiceManagedIdentityAutoGenerated + public partial class ServiceManagedIdentity1 { /// @@ -56,22 +56,22 @@ public partial class ServiceManagedIdentityAutoGenerated partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceManagedIdentityAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceManagedIdentity1 FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServiceManagedIdentityAutoGenerated(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServiceManagedIdentity1(json) : null; } /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject into a new instance of . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject into a new instance of . /// /// A Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject instance to deserialize from. - internal ServiceManagedIdentityAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json) + internal ServiceManagedIdentity1(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); @@ -79,22 +79,21 @@ internal ServiceManagedIdentityAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets. { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} - {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : UserAssignedIdentity;} + {_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;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} AfterFromJson(json); } /// - /// 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.HealthcareApis.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode) { @@ -107,11 +106,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T return container; } AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceOciArtifactEntry.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceOciArtifactEntry.PowerShell.cs similarity index 70% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceOciArtifactEntry.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceOciArtifactEntry.PowerShell.cs index 29c93cb53cb6..56a488f6e230 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceOciArtifactEntry.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceOciArtifactEntry.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ServiceOciArtifactEntry partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServiceOciArtifactEntry(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.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServiceOciArtifactEntry(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,21 +111,21 @@ internal ServiceOciArtifactEntry(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("LoginServer")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntryInternal)this).LoginServer = (string) content.GetValueForProperty("LoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntryInternal)this).LoginServer, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntryInternal)this).LoginServer = (string) content.GetValueForProperty("LoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntryInternal)this).LoginServer, global::System.Convert.ToString); } if (content.Contains("ImageName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntryInternal)this).ImageName = (string) content.GetValueForProperty("ImageName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntryInternal)this).ImageName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntryInternal)this).ImageName = (string) content.GetValueForProperty("ImageName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntryInternal)this).ImageName, global::System.Convert.ToString); } if (content.Contains("Digest")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntryInternal)this).Digest = (string) content.GetValueForProperty("Digest",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntryInternal)this).Digest, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntryInternal)this).Digest = (string) content.GetValueForProperty("Digest",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntryInternal)this).Digest, 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. @@ -134,15 +140,15 @@ internal ServiceOciArtifactEntry(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("LoginServer")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntryInternal)this).LoginServer = (string) content.GetValueForProperty("LoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntryInternal)this).LoginServer, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntryInternal)this).LoginServer = (string) content.GetValueForProperty("LoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntryInternal)this).LoginServer, global::System.Convert.ToString); } if (content.Contains("ImageName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntryInternal)this).ImageName = (string) content.GetValueForProperty("ImageName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntryInternal)this).ImageName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntryInternal)this).ImageName = (string) content.GetValueForProperty("ImageName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntryInternal)this).ImageName, global::System.Convert.ToString); } if (content.Contains("Digest")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntryInternal)this).Digest = (string) content.GetValueForProperty("Digest",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntryInternal)this).Digest, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntryInternal)this).Digest = (string) content.GetValueForProperty("Digest",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntryInternal)this).Digest, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,6 +157,18 @@ internal ServiceOciArtifactEntry(global::System.Management.Automation.PSObject c /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 Open Container Initiative (OCI) artifact. [System.ComponentModel.TypeConverter(typeof(ServiceOciArtifactEntryTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceOciArtifactEntry.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceOciArtifactEntry.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceOciArtifactEntry.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceOciArtifactEntry.TypeConverter.cs index 8230b8c289ce..a10b1867685f 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceOciArtifactEntry.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceOciArtifactEntry.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceOciArtifactEntry.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceOciArtifactEntry.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceOciArtifactEntry.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceOciArtifactEntry.cs index 032da30485ad..84af17a995f8 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceOciArtifactEntry.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceOciArtifactEntry.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// An Open Container Initiative (OCI) artifact. public partial class ServiceOciArtifactEntry : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntryInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntryInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IServiceOciArtifactEntry : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The artifact digest.", SerializedName = @"digest", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IServiceOciArtifactEntry : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The artifact name.", SerializedName = @"imageName", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IServiceOciArtifactEntry : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Azure Container Registry login server.", SerializedName = @"loginServer", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceOciArtifactEntry.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceOciArtifactEntry.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceOciArtifactEntry.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceOciArtifactEntry.json.cs index ad2248ae7881..35c93a85eb38 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceOciArtifactEntry.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceOciArtifactEntry.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServiceOciArtifactEntry partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServiceOciArtifactEntry(json) : null; } @@ -77,9 +77,9 @@ internal ServiceOciArtifactEntry(Microsoft.Azure.PowerShell.Cmdlets.HealthcareAp { return; } - {_loginServer = If( json?.PropertyT("loginServer"), out var __jsonLoginServer) ? (string)__jsonLoginServer : (string)LoginServer;} - {_imageName = If( json?.PropertyT("imageName"), out var __jsonImageName) ? (string)__jsonImageName : (string)ImageName;} - {_digest = If( json?.PropertyT("digest"), out var __jsonDigest) ? (string)__jsonDigest : (string)Digest;} + {_loginServer = If( json?.PropertyT("loginServer"), out var __jsonLoginServer) ? (string)__jsonLoginServer : (string)_loginServer;} + {_imageName = If( json?.PropertyT("imageName"), out var __jsonImageName) ? (string)__jsonImageName : (string)_imageName;} + {_digest = If( json?.PropertyT("digest"), out var __jsonDigest) ? (string)__jsonDigest : (string)_digest;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceSpecification.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceSpecification.PowerShell.cs similarity index 65% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceSpecification.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceSpecification.PowerShell.cs index c1ec8717bbe1..cd7e5dc49c96 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceSpecification.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ServiceSpecification partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecification DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServiceSpecification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServiceSpecification(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,17 +111,17 @@ internal ServiceSpecification(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("LogSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecificationInternal)this).LogSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification[]) content.GetValueForProperty("LogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecificationInternal)this).LogSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.LogSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecificationInternal)this).LogSpecification = (System.Collections.Generic.List) content.GetValueForProperty("LogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecificationInternal)this).LogSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.LogSpecificationTypeConverter.ConvertFrom)); } if (content.Contains("MetricSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecificationInternal)this).MetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification[]) content.GetValueForProperty("MetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecificationInternal)this).MetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.MetricSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecificationInternal)this).MetricSpecification = (System.Collections.Generic.List) content.GetValueForProperty("MetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecificationInternal)this).MetricSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. @@ -130,11 +136,11 @@ internal ServiceSpecification(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("LogSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecificationInternal)this).LogSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification[]) content.GetValueForProperty("LogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecificationInternal)this).LogSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.LogSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecificationInternal)this).LogSpecification = (System.Collections.Generic.List) content.GetValueForProperty("LogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecificationInternal)this).LogSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.LogSpecificationTypeConverter.ConvertFrom)); } if (content.Contains("MetricSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecificationInternal)this).MetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification[]) content.GetValueForProperty("MetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecificationInternal)this).MetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.MetricSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecificationInternal)this).MetricSpecification = (System.Collections.Generic.List) content.GetValueForProperty("MetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecificationInternal)this).MetricSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.MetricSpecificationTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -143,6 +149,18 @@ internal ServiceSpecification(global::System.Management.Automation.PSObject cont /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Service specification payload [System.ComponentModel.TypeConverter(typeof(ServiceSpecificationTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceSpecification.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceSpecification.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceSpecification.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceSpecification.TypeConverter.cs index c1287ff52ed0..f0eb61d8faf7 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceSpecification.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServiceSpecification ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecification ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecification).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecification).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceSpecification.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceSpecification.cs similarity index 62% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceSpecification.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceSpecification.cs index 173dd86f1d60..2fbd74848358 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceSpecification.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Service specification payload public partial class ServiceSpecification : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecification, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecificationInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecification, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecificationInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification[] _logSpecification; + private System.Collections.Generic.List _logSpecification; /// Specifications of the Log for Azure Monitoring [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.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.HealthcareApis.Models.Api20211101.IMetricSpecification[] _metricSpecification; + private System.Collections.Generic.List _metricSpecification; /// Specifications of the Metrics for Azure Monitoring [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.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.HealthcareApis.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.HealthcareApis.Models.Api20211101.ILogSpecification) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILogSpecification[] LogSpecification { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILogSpecification) })] + System.Collections.Generic.List LogSpecification { get; set; } /// Specifications of the Metrics for Azure Monitoring [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IMetricSpecification) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification[] MetricSpecification { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.ILogSpecification[] LogSpecification { get; set; } + System.Collections.Generic.List LogSpecification { get; set; } /// Specifications of the Metrics for Azure Monitoring - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IMetricSpecification[] MetricSpecification { get; set; } + System.Collections.Generic.List MetricSpecification { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceSpecification.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceSpecification.json.cs similarity index 87% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceSpecification.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServiceSpecification.json.cs index fd42c8624ee2..4ecc94b0fdb6 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServiceSpecification.json.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServiceSpecification partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecification. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecification. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecification. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecification. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServiceSpecification(json) : null; } @@ -77,8 +77,8 @@ internal ServiceSpecification(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis. { return; } - {_logSpecification = If( json?.PropertyT("logSpecifications"), out var __jsonLogSpecifications) ? If( __jsonLogSpecifications as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.ILogSpecification) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.LogSpecification.FromJson(__u) )) ))() : null : LogSpecification;} - {_metricSpecification = If( json?.PropertyT("metricSpecifications"), out var __jsonMetricSpecifications) ? If( __jsonMetricSpecifications as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IMetricSpecification) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.MetricSpecification.FromJson(__p) )) ))() : null : MetricSpecification;} + {_logSpecification = If( json?.PropertyT("logSpecifications"), out var __jsonLogSpecifications) ? If( __jsonLogSpecifications as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.ILogSpecification) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.LogSpecification.FromJson(__u) )) ))() : null : _logSpecification;} + {_metricSpecification = If( json?.PropertyT("metricSpecifications"), out var __jsonMetricSpecifications) ? If( __jsonMetricSpecifications as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IMetricSpecification) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.MetricSpecification.FromJson(__p) )) ))() : null : _metricSpecification;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescription.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescription.PowerShell.cs new file mode 100644 index 000000000000..1f1dff8d000e --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescription.PowerShell.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.HealthcareApis.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + + /// The description of the service. + [System.ComponentModel.TypeConverter(typeof(ServicesDescriptionTypeConverter))] + public partial class ServicesDescription + { + + /// + /// 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.HealthcareApis.Models.IServicesDescription DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ServicesDescription(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.HealthcareApis.Models.IServicesDescription DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ServicesDescription(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.HealthcareApis.Models.IServicesDescription FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ServicesDescription(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.HealthcareApis.Models.IServicesDescriptionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CosmosDbConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CosmosDbConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo) content.GetValueForProperty("CosmosDbConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CosmosDbConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceCosmosDbConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AuthenticationConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAuthenticationConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("CorsConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorsConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo) content.GetValueForProperty("CorsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorsConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceCorsConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExportConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).ExportConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo) content.GetValueForProperty("ExportConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).ExportConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceExportConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AcrConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AcrConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo) content.GetValueForProperty("AcrConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AcrConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAcrConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AccessPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AccessPolicy = (System.Collections.Generic.List) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AccessPolicy, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAccessPolicyEntryTypeConverter.ConvertFrom)); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).PublicNetworkAccess, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CosmoDbConfigurationOfferThroughput")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CosmoDbConfigurationOfferThroughput = (int?) content.GetValueForProperty("CosmoDbConfigurationOfferThroughput",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CosmoDbConfigurationOfferThroughput, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CosmoDbConfigurationKeyVaultKeyUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CosmoDbConfigurationKeyVaultKeyUri = (string) content.GetValueForProperty("CosmoDbConfigurationKeyVaultKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CosmoDbConfigurationKeyVaultKeyUri, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationAudience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AuthenticationConfigurationAudience = (string) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AuthenticationConfigurationAudience, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationSmartProxyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AuthenticationConfigurationSmartProxyEnabled = (bool?) content.GetValueForProperty("AuthenticationConfigurationSmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AuthenticationConfigurationSmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CorConfigurationOrigin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationOrigin = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationOrigin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationOrigin, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationHeader = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationHeader",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationHeader, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationMethod = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationMethod",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationMethod, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationMaxAge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationMaxAge = (int?) content.GetValueForProperty("CorConfigurationMaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationMaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CorConfigurationAllowCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationAllowCredentials = (bool?) content.GetValueForProperty("CorConfigurationAllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationAllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExportConfigurationStorageAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).ExportConfigurationStorageAccountName = (string) content.GetValueForProperty("ExportConfigurationStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).ExportConfigurationStorageAccountName, global::System.Convert.ToString); + } + if (content.Contains("AcrConfigurationLoginServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AcrConfigurationLoginServer = (System.Collections.Generic.List) content.GetValueForProperty("AcrConfigurationLoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AcrConfigurationLoginServer, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AcrConfigurationOciArtifact")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AcrConfigurationOciArtifact = (System.Collections.Generic.List) content.GetValueForProperty("AcrConfigurationOciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AcrConfigurationOciArtifact, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ServicesDescription(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.HealthcareApis.Models.IServicesDescriptionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CosmosDbConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CosmosDbConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo) content.GetValueForProperty("CosmosDbConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CosmosDbConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceCosmosDbConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AuthenticationConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAuthenticationConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("CorsConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorsConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo) content.GetValueForProperty("CorsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorsConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceCorsConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExportConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).ExportConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo) content.GetValueForProperty("ExportConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).ExportConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceExportConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AcrConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AcrConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo) content.GetValueForProperty("AcrConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AcrConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAcrConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AccessPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AccessPolicy = (System.Collections.Generic.List) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AccessPolicy, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAccessPolicyEntryTypeConverter.ConvertFrom)); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).PublicNetworkAccess, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CosmoDbConfigurationOfferThroughput")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CosmoDbConfigurationOfferThroughput = (int?) content.GetValueForProperty("CosmoDbConfigurationOfferThroughput",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CosmoDbConfigurationOfferThroughput, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CosmoDbConfigurationKeyVaultKeyUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CosmoDbConfigurationKeyVaultKeyUri = (string) content.GetValueForProperty("CosmoDbConfigurationKeyVaultKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CosmoDbConfigurationKeyVaultKeyUri, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationAudience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AuthenticationConfigurationAudience = (string) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AuthenticationConfigurationAudience, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationSmartProxyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AuthenticationConfigurationSmartProxyEnabled = (bool?) content.GetValueForProperty("AuthenticationConfigurationSmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AuthenticationConfigurationSmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CorConfigurationOrigin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationOrigin = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationOrigin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationOrigin, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationHeader = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationHeader",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationHeader, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationMethod = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationMethod",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationMethod, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationMaxAge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationMaxAge = (int?) content.GetValueForProperty("CorConfigurationMaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationMaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CorConfigurationAllowCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationAllowCredentials = (bool?) content.GetValueForProperty("CorConfigurationAllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).CorConfigurationAllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExportConfigurationStorageAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).ExportConfigurationStorageAccountName = (string) content.GetValueForProperty("ExportConfigurationStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).ExportConfigurationStorageAccountName, global::System.Convert.ToString); + } + if (content.Contains("AcrConfigurationLoginServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AcrConfigurationLoginServer = (System.Collections.Generic.List) content.GetValueForProperty("AcrConfigurationLoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AcrConfigurationLoginServer, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AcrConfigurationOciArtifact")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AcrConfigurationOciArtifact = (System.Collections.Generic.List) content.GetValueForProperty("AcrConfigurationOciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal)this).AcrConfigurationOciArtifact, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); + } + 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.HealthcareApis.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 description of the service. + [System.ComponentModel.TypeConverter(typeof(ServicesDescriptionTypeConverter))] + public partial interface IServicesDescription + + { + + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescription.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescription.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescription.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescription.TypeConverter.cs index 4566282c073a..840b698f4b1e 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescription.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServicesDescription ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescription.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescription.cs similarity index 56% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescription.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescription.cs index 2f3f7c5b9db9..01b33e9be6c5 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescription.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescription.cs @@ -3,206 +3,227 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The description of the service. public partial class ServicesDescription : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResource __servicesResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResource(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResource __servicesResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResource(); /// The access policies of the service instance. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry[] AccessPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).AccessPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).AccessPolicy = value ?? null /* arrayOf */; } + public System.Collections.Generic.List AccessPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).AccessPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).AccessPolicy = value ?? null /* arrayOf */; } /// The list of the ACR login servers. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string[] AcrConfigurationLoginServer { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).AcrConfigurationLoginServer; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).AcrConfigurationLoginServer = value ?? null /* arrayOf */; } + public System.Collections.Generic.List AcrConfigurationLoginServer { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).AcrConfigurationLoginServer; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).AcrConfigurationLoginServer = value ?? null /* arrayOf */; } /// The list of Open Container Initiative (OCI) artifacts. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).AcrConfigurationOciArtifact; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).AcrConfigurationOciArtifact = value ?? null /* arrayOf */; } + public System.Collections.Generic.List AcrConfigurationOciArtifact { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).AcrConfigurationOciArtifact; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).AcrConfigurationOciArtifact = value ?? null /* arrayOf */; } /// The audience url for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string AuthenticationConfigurationAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).AuthenticationConfigurationAudience; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).AuthenticationConfigurationAudience = value ?? null; } + public string AuthenticationConfigurationAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).AuthenticationConfigurationAudience; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).AuthenticationConfigurationAudience = value ?? null; } /// The authority url for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string AuthenticationConfigurationAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).AuthenticationConfigurationAuthority; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).AuthenticationConfigurationAuthority = value ?? null; } + public string AuthenticationConfigurationAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).AuthenticationConfigurationAuthority; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).AuthenticationConfigurationAuthority = value ?? null; } /// If the SMART on FHIR proxy is enabled [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public bool? AuthenticationConfigurationSmartProxyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).AuthenticationConfigurationSmartProxyEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).AuthenticationConfigurationSmartProxyEnabled = value ?? default(bool); } + public bool? AuthenticationConfigurationSmartProxyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).AuthenticationConfigurationSmartProxyEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).AuthenticationConfigurationSmartProxyEnabled = value ?? default(bool); } /// If credentials are allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public bool? CorConfigurationAllowCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).CorConfigurationAllowCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).CorConfigurationAllowCredentials = value ?? default(bool); } + public bool? CorConfigurationAllowCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).CorConfigurationAllowCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).CorConfigurationAllowCredentials = value ?? default(bool); } /// The headers to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string[] CorConfigurationHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).CorConfigurationHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).CorConfigurationHeader = value ?? null /* arrayOf */; } + public System.Collections.Generic.List CorConfigurationHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).CorConfigurationHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).CorConfigurationHeader = value ?? null /* arrayOf */; } /// The max age to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public int? CorConfigurationMaxAge { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).CorConfigurationMaxAge; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).CorConfigurationMaxAge = value ?? default(int); } + public int? CorConfigurationMaxAge { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).CorConfigurationMaxAge; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).CorConfigurationMaxAge = value ?? default(int); } /// The methods to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string[] CorConfigurationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).CorConfigurationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).CorConfigurationMethod = value ?? null /* arrayOf */; } + public System.Collections.Generic.List CorConfigurationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).CorConfigurationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).CorConfigurationMethod = value ?? null /* arrayOf */; } /// The origins to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string[] CorConfigurationOrigin { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).CorConfigurationOrigin; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).CorConfigurationOrigin = value ?? null /* arrayOf */; } + public System.Collections.Generic.List CorConfigurationOrigin { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).CorConfigurationOrigin; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).CorConfigurationOrigin = value ?? null /* arrayOf */; } /// The URI of the customer-managed key for the backing database. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string CosmoDbConfigurationKeyVaultKeyUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).CosmoDbConfigurationKeyVaultKeyUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).CosmoDbConfigurationKeyVaultKeyUri = value ?? null; } + public string CosmoDbConfigurationKeyVaultKeyUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).CosmoDbConfigurationKeyVaultKeyUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).CosmoDbConfigurationKeyVaultKeyUri = value ?? null; } /// The provisioned throughput for the backing database. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public int? CosmoDbConfigurationOfferThroughput { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).CosmoDbConfigurationOfferThroughput; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).CosmoDbConfigurationOfferThroughput = value ?? default(int); } + public int? CosmoDbConfigurationOfferThroughput { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).CosmoDbConfigurationOfferThroughput; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).CosmoDbConfigurationOfferThroughput = value ?? default(int); } /// /// An etag associated with the resource, used for optimistic concurrency when editing it. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Etag = value ?? null; } /// The name of the default export storage account. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string ExportConfigurationStorageAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).ExportConfigurationStorageAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).ExportConfigurationStorageAccountName = value ?? null; } + public string ExportConfigurationStorageAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).ExportConfigurationStorageAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).ExportConfigurationStorageAccountName = value ?? null; } /// The resource identifier. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Id; } /// /// Setting indicating whether the service has a managed identity associated with it. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentity Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Identity = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Identity = value ?? null /* model class */; } /// The principal ID of the resource identity. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).IdentityPrincipalId; } + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).IdentityPrincipalId; } /// The tenant ID of the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).IdentityTenantId; } + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).IdentityTenantId; } /// /// Type of identity being specified, currently SystemAssigned and None are allowed. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).IdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType)""); } + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).IdentityType = value ?? null; } /// The kind of the service. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.FormatTable(Index = 2)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Kind = value ; } + public string Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Kind = value ; } /// The resource location. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.FormatTable(Index = 0)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Location = value ; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Location = value ?? null; } /// Internal Acessors for AcrConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal.AcrConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).AcrConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).AcrConfiguration = value; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal.AcrConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).AcrConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).AcrConfiguration = value ?? null /* model class */; } /// Internal Acessors for AuthenticationConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal.AuthenticationConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).AuthenticationConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).AuthenticationConfiguration = value; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal.AuthenticationConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).AuthenticationConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).AuthenticationConfiguration = value ?? null /* model class */; } /// Internal Acessors for CorsConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal.CorsConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).CorsConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).CorsConfiguration = value; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal.CorsConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).CorsConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).CorsConfiguration = value ?? null /* model class */; } /// Internal Acessors for CosmosDbConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal.CosmosDbConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).CosmosDbConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).CosmosDbConfiguration = value; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal.CosmosDbConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).CosmosDbConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).CosmosDbConfiguration = value ?? null /* model class */; } /// Internal Acessors for ExportConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal.ExportConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).ExportConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).ExportConfiguration = value; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal.ExportConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).ExportConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).ExportConfiguration = value ?? null /* model class */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).ProvisioningState = value ?? null; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Id = value ?? null; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal.Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Identity = value ?? null /* model class */; } /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).IdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).IdentityPrincipalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).IdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).IdentityPrincipalId = value ?? null; } /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).IdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).IdentityTenantId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).IdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).IdentityTenantId = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Type = value ?? null; } /// The resource name. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.FormatTable(Index = 1)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Name; } /// The list of private endpoint connections that are set up for this resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).PrivateEndpointConnection = value ?? null /* arrayOf */; } + public System.Collections.Generic.List PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).PrivateEndpointConnection = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesProperties _property; /// The common properties of a service. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesProperties()); set => this._property = value; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).ProvisioningState; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal)Property).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess)""); } + public string PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)Property).PublicNetworkAccess = value ?? null; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] @@ -210,52 +231,52 @@ public partial class ServicesDescription : 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); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData _systemData; /// Metadata pertaining to creation and last modification of the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// The resource tags. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Tag = value ?? null /* model class */; } /// The resource type. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)__servicesResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)__servicesResource).Type; } /// Creates an new instance. public ServicesDescription() @@ -278,36 +299,48 @@ public ServicesDescription() /// The description of the service. public partial interface IServicesDescription : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResource { /// The access policies of the service instance. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The access policies of the service instance.", SerializedName = @"accessPolicies", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry[] AccessPolicy { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntry) })] + System.Collections.Generic.List AccessPolicy { get; set; } /// The list of the ACR login servers. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of the ACR login servers.", SerializedName = @"loginServers", PossibleTypes = new [] { typeof(string) })] - string[] AcrConfigurationLoginServer { get; set; } + System.Collections.Generic.List AcrConfigurationLoginServer { get; set; } /// The list of Open Container Initiative (OCI) artifacts. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Open Container Initiative (OCI) artifacts.", SerializedName = @"ociArtifacts", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry) })] + System.Collections.Generic.List AcrConfigurationOciArtifact { get; set; } /// The audience url for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The audience url for the service", SerializedName = @"audience", PossibleTypes = new [] { typeof(string) })] @@ -316,6 +349,9 @@ public partial interface IServicesDescription : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The authority url for the service", SerializedName = @"authority", PossibleTypes = new [] { typeof(string) })] @@ -324,6 +360,9 @@ public partial interface IServicesDescription : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If the SMART on FHIR proxy is enabled", SerializedName = @"smartProxyEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -332,6 +371,9 @@ public partial interface IServicesDescription : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If credentials are allowed via CORS.", SerializedName = @"allowCredentials", PossibleTypes = new [] { typeof(bool) })] @@ -340,14 +382,20 @@ public partial interface IServicesDescription : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The headers to be allowed via CORS.", SerializedName = @"headers", PossibleTypes = new [] { typeof(string) })] - string[] CorConfigurationHeader { get; set; } + System.Collections.Generic.List CorConfigurationHeader { get; set; } /// The max age to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The max age to be allowed via CORS.", SerializedName = @"maxAge", PossibleTypes = new [] { typeof(int) })] @@ -356,22 +404,31 @@ public partial interface IServicesDescription : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The methods to be allowed via CORS.", SerializedName = @"methods", PossibleTypes = new [] { typeof(string) })] - string[] CorConfigurationMethod { get; set; } + System.Collections.Generic.List CorConfigurationMethod { get; set; } /// The origins to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The origins to be allowed via CORS.", SerializedName = @"origins", PossibleTypes = new [] { typeof(string) })] - string[] CorConfigurationOrigin { get; set; } + System.Collections.Generic.List CorConfigurationOrigin { get; set; } /// The URI of the customer-managed key for the backing database. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URI of the customer-managed key for the backing database.", SerializedName = @"keyVaultKeyUri", PossibleTypes = new [] { typeof(string) })] @@ -380,6 +437,9 @@ public partial interface IServicesDescription : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The provisioned throughput for the backing database.", SerializedName = @"offerThroughput", PossibleTypes = new [] { typeof(int) })] @@ -388,6 +448,9 @@ public partial interface IServicesDescription : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the default export storage account.", SerializedName = @"storageAccountName", PossibleTypes = new [] { typeof(string) })] @@ -396,94 +459,125 @@ public partial interface IServicesDescription : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of private endpoint connections that are set up for this resource.", SerializedName = @"privateEndpointConnections", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection) })] + System.Collections.Generic.List PrivateEndpointConnection { get; set; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } + global::System.DateTime? SystemDataCreatedAt { get; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } + string SystemDataCreatedBy { get; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } + global::System.DateTime? SystemDataLastModifiedAt { get; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } + string SystemDataLastModifiedBy { get; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } } /// The description of the service. internal partial interface IServicesDescriptionInternal : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal { /// The access policies of the service instance. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry[] AccessPolicy { get; set; } + System.Collections.Generic.List AccessPolicy { get; set; } /// /// The azure container registry settings used for convert data operation of the service instance. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo AcrConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo AcrConfiguration { get; set; } /// The list of the ACR login servers. - string[] AcrConfigurationLoginServer { get; set; } + System.Collections.Generic.List AcrConfigurationLoginServer { get; set; } /// The list of Open Container Initiative (OCI) artifacts. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get; set; } + System.Collections.Generic.List AcrConfigurationOciArtifact { get; set; } /// The authentication configuration for the service instance. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo AuthenticationConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo AuthenticationConfiguration { get; set; } /// The audience url for the service string AuthenticationConfigurationAudience { get; set; } /// The authority url for the service @@ -493,49 +587,53 @@ internal partial interface IServicesDescriptionInternal : /// If credentials are allowed via CORS. bool? CorConfigurationAllowCredentials { get; set; } /// The headers to be allowed via CORS. - string[] CorConfigurationHeader { get; set; } + System.Collections.Generic.List CorConfigurationHeader { get; set; } /// The max age to be allowed via CORS. int? CorConfigurationMaxAge { get; set; } /// The methods to be allowed via CORS. - string[] CorConfigurationMethod { get; set; } + System.Collections.Generic.List CorConfigurationMethod { get; set; } /// The origins to be allowed via CORS. - string[] CorConfigurationOrigin { get; set; } + System.Collections.Generic.List CorConfigurationOrigin { get; set; } /// The settings for the CORS configuration of the service instance. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo CorsConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo CorsConfiguration { get; set; } /// The URI of the customer-managed key for the backing database. string CosmoDbConfigurationKeyVaultKeyUri { get; set; } /// The provisioned throughput for the backing database. int? CosmoDbConfigurationOfferThroughput { get; set; } /// The settings for the Cosmos DB database backing the service. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo CosmosDbConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo CosmosDbConfiguration { get; set; } /// The settings for the export operation of the service instance. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo ExportConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo ExportConfiguration { get; set; } /// The name of the default export storage account. string ExportConfigurationStorageAccountName { get; set; } /// The list of private endpoint connections that are set up for this resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + System.Collections.Generic.List PrivateEndpointConnection { get; set; } /// The common properties of a service. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesProperties Property { get; set; } /// The provisioning state. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; set; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } /// Metadata pertaining to creation and last modification of the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData SystemData { get; set; } /// The timestamp of resource creation (UTC). global::System.DateTime? SystemDataCreatedAt { get; set; } /// The identity that created the resource. string SystemDataCreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// The identity that last modified the resource. string SystemDataLastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescription.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescription.json.cs similarity index 92% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescription.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescription.json.cs index c0c66b482235..4e1e027127d6 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescription.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServicesDescription partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServicesDescription(json) : null; } @@ -77,9 +77,9 @@ internal ServicesDescription(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.R { return; } - __servicesResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesProperties.FromJson(__jsonProperties) : Property;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData.FromJson(__jsonSystemData) : SystemData;} + __servicesResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesProperties.FromJson(__jsonProperties) : _property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} AfterFromJson(json); } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T } __servicesResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescriptionListResult.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescriptionListResult.PowerShell.cs similarity index 69% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescriptionListResult.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescriptionListResult.PowerShell.cs index 999c410f0b85..caaaa362e485 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescriptionListResult.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescriptionListResult.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ServicesDescriptionListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServicesDescriptionListResult(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.HealthcareApis.Models.Api20211101.IServicesDescriptionListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServicesDescriptionListResult(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,17 +111,17 @@ internal ServicesDescriptionListResult(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResultInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesDescriptionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesDescriptionTypeConverter.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. @@ -130,11 +136,11 @@ internal ServicesDescriptionListResult(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResultInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesDescriptionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesDescriptionTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -143,6 +149,18 @@ internal ServicesDescriptionListResult(global::System.Management.Automation.PSOb /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// A list of service description objects with a next link. [System.ComponentModel.TypeConverter(typeof(ServicesDescriptionListResultTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescriptionListResult.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescriptionListResult.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescriptionListResult.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescriptionListResult.TypeConverter.cs index 743c9ae85c79..9becbd91ad92 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescriptionListResult.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescriptionListResult.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServicesDescriptionListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescriptionListResult.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescriptionListResult.cs similarity index 77% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescriptionListResult.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescriptionListResult.cs index 7799da4450ce..f41d7bb5ef0f 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescriptionListResult.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescriptionListResult.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// A list of service description objects with a next link. public partial class ServicesDescriptionListResult : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionListResult, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResult, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class ServicesDescriptionListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription[] _value; + private System.Collections.Generic.List _value; /// A list of service description objects. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public ServicesDescriptionListResult() @@ -41,6 +41,9 @@ public partial interface IServicesDescriptionListResult : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link used to get the next page of service description objects.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IServicesDescriptionListResult : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of service description objects.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription) })] + System.Collections.Generic.List Value { get; set; } } /// A list of service description objects with a next link. @@ -62,7 +68,7 @@ internal partial interface IServicesDescriptionListResultInternal /// The link used to get the next page of service description objects. string NextLink { get; set; } /// A list of service description objects. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescriptionListResult.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescriptionListResult.json.cs similarity index 90% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescriptionListResult.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescriptionListResult.json.cs index fb3babfc0270..32162c532990 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesDescriptionListResult.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesDescriptionListResult.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServicesDescriptionListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServicesDescriptionListResult(json) : null; } @@ -77,8 +77,8 @@ internal ServicesDescriptionListResult(Microsoft.Azure.PowerShell.Cmdlets.Health { return; } - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServicesDescription) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesDescription.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.HealthcareApis.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.HealthcareApis.Models.IServicesDescription) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesDescription.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesNameAvailabilityInfo.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesNameAvailabilityInfo.PowerShell.cs similarity index 70% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesNameAvailabilityInfo.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesNameAvailabilityInfo.PowerShell.cs index e70fce10cf63..5a13404636fb 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesNameAvailabilityInfo.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesNameAvailabilityInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ServicesNameAvailabilityInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServicesNameAvailabilityInfo(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.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServicesNameAvailabilityInfo(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,21 +111,21 @@ internal ServicesNameAvailabilityInfo(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("NameAvailable")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfoInternal)this).NameAvailable = (bool?) content.GetValueForProperty("NameAvailable",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfoInternal)this).NameAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfoInternal)this).NameAvailable = (bool?) content.GetValueForProperty("NameAvailable",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfoInternal)this).NameAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Reason")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfoInternal)this).Reason = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceNameUnavailabilityReason?) content.GetValueForProperty("Reason",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfoInternal)this).Reason, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceNameUnavailabilityReason.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfoInternal)this).Reason = (string) content.GetValueForProperty("Reason",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfoInternal)this).Reason, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfoInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfoInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfoInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfoInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,15 +140,15 @@ internal ServicesNameAvailabilityInfo(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("NameAvailable")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfoInternal)this).NameAvailable = (bool?) content.GetValueForProperty("NameAvailable",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfoInternal)this).NameAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfoInternal)this).NameAvailable = (bool?) content.GetValueForProperty("NameAvailable",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfoInternal)this).NameAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Reason")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfoInternal)this).Reason = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceNameUnavailabilityReason?) content.GetValueForProperty("Reason",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfoInternal)this).Reason, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceNameUnavailabilityReason.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfoInternal)this).Reason = (string) content.GetValueForProperty("Reason",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfoInternal)this).Reason, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfoInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfoInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfoInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfoInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,6 +157,18 @@ internal ServicesNameAvailabilityInfo(global::System.Management.Automation.PSObj /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 indicating whether a given service name is available. [System.ComponentModel.TypeConverter(typeof(ServicesNameAvailabilityInfoTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesNameAvailabilityInfo.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesNameAvailabilityInfo.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesNameAvailabilityInfo.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesNameAvailabilityInfo.TypeConverter.cs index f013391d1c46..39dc171e76b8 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesNameAvailabilityInfo.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesNameAvailabilityInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesNameAvailabilityInfo.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesNameAvailabilityInfo.cs similarity index 77% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesNameAvailabilityInfo.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesNameAvailabilityInfo.cs index bce95238c1fc..aad97a7cf1a6 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesNameAvailabilityInfo.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesNameAvailabilityInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The properties indicating whether a given service name is available. public partial class ServicesNameAvailabilityInfo : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfoInternal { /// Backing field for property. @@ -21,10 +21,10 @@ public partial class ServicesNameAvailabilityInfo : public string Message { get => this._message; set => this._message = value; } /// Internal Acessors for NameAvailable - bool? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfoInternal.NameAvailable { get => this._nameAvailable; set { {_nameAvailable = value;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfoInternal.NameAvailable { get => this._nameAvailable; set { {_nameAvailable = value;} } } /// Internal Acessors for Reason - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceNameUnavailabilityReason? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfoInternal.Reason { get => this._reason; set { {_reason = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfoInternal.Reason { get => this._reason; set { {_reason = value;} } } /// Backing field for property. private bool? _nameAvailable; @@ -34,11 +34,11 @@ public partial class ServicesNameAvailabilityInfo : public bool? NameAvailable { get => this._nameAvailable; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceNameUnavailabilityReason? _reason; + private string _reason; /// The reason for unavailability. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceNameUnavailabilityReason? Reason { get => this._reason; } + public string Reason { get => this._reason; } /// Creates an new instance. public ServicesNameAvailabilityInfo() @@ -54,6 +54,9 @@ public partial interface IServicesNameAvailabilityInfo : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The detailed reason message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -62,6 +65,9 @@ public partial interface IServicesNameAvailabilityInfo : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The value which indicates whether the provided name is available.", SerializedName = @"nameAvailable", PossibleTypes = new [] { typeof(bool) })] @@ -70,10 +76,14 @@ public partial interface IServicesNameAvailabilityInfo : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The reason for unavailability.", SerializedName = @"reason", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceNameUnavailabilityReason) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceNameUnavailabilityReason? Reason { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Invalid", "AlreadyExists")] + string Reason { get; } } /// The properties indicating whether a given service name is available. @@ -85,7 +95,8 @@ internal partial interface IServicesNameAvailabilityInfoInternal /// The value which indicates whether the provided name is available. bool? NameAvailable { get; set; } /// The reason for unavailability. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceNameUnavailabilityReason? Reason { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Invalid", "AlreadyExists")] + string Reason { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesNameAvailabilityInfo.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesNameAvailabilityInfo.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesNameAvailabilityInfo.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesNameAvailabilityInfo.json.cs index 6c30b8040acf..31b7fddd3624 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesNameAvailabilityInfo.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesNameAvailabilityInfo.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServicesNameAvailabilityInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServicesNameAvailabilityInfo(json) : null; } @@ -77,9 +77,9 @@ internal ServicesNameAvailabilityInfo(Microsoft.Azure.PowerShell.Cmdlets.Healthc { return; } - {_nameAvailable = If( json?.PropertyT("nameAvailable"), out var __jsonNameAvailable) ? (bool?)__jsonNameAvailable : NameAvailable;} - {_reason = If( json?.PropertyT("reason"), out var __jsonReason) ? (string)__jsonReason : (string)Reason;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_nameAvailable = If( json?.PropertyT("nameAvailable"), out var __jsonNameAvailable) ? (bool?)__jsonNameAvailable : _nameAvailable;} + {_reason = If( json?.PropertyT("reason"), out var __jsonReason) ? (string)__jsonReason : (string)_reason;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} AfterFromJson(json); } @@ -102,11 +102,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._nameAvailable ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonBoolean((bool)this._nameAvailable) : null, "nameAvailable" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._reason)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._reason.ToString()) : null, "reason" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescription.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescription.PowerShell.cs similarity index 66% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescription.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescription.PowerShell.cs index 46095cac9e18..a77c1e1b9780 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescription.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ServicesPatchDescription partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescription DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescription DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServicesPatchDescription(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.HealthcareApis.Models.Api20211101.IServicesPatchDescription DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescription DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServicesPatchDescription(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescription FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescription FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,21 +111,21 @@ internal ServicesPatchDescription(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParameters) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesPropertiesUpdateParametersTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParameters) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesPropertiesUpdateParametersTypeConverter.ConvertFrom); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesPatchDescriptionTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesPatchDescriptionTagsTypeConverter.ConvertFrom); } if (content.Contains("PublicNetworkAccess")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionInternal)this).PublicNetworkAccess, 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. @@ -134,15 +140,15 @@ internal ServicesPatchDescription(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParameters) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesPropertiesUpdateParametersTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParameters) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesPropertiesUpdateParametersTypeConverter.ConvertFrom); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesPatchDescriptionTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesPatchDescriptionTagsTypeConverter.ConvertFrom); } if (content.Contains("PublicNetworkAccess")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionInternal)this).PublicNetworkAccess, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,6 +157,18 @@ internal ServicesPatchDescription(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 description of the service. [System.ComponentModel.TypeConverter(typeof(ServicesPatchDescriptionTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescription.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescription.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescription.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescription.TypeConverter.cs index acb3bf69b66a..adb5e5deb5ce 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescription.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServicesPatchDescription ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescription ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescription).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescription).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescription.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescription.cs similarity index 62% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescription.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescription.cs index ee03f12817e7..0d8484544dfb 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescription.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The description of the service. public partial class ServicesPatchDescription : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescription, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescription, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionInternal { /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParameters Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesPropertiesUpdateParameters()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParameters Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesPropertiesUpdateParameters()); set { {_property = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParameters _property; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParameters _property; /// The properties for updating a service instance. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParameters Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesPropertiesUpdateParameters()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParameters Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesPropertiesUpdateParameters()); set => this._property = value; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParametersInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParametersInternal)Property).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess)""); } + public string PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParametersInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParametersInternal)Property).PublicNetworkAccess = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags _tag; /// Instance tags [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesPatchDescriptionTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesPatchDescriptionTags()); set => this._tag = value; } /// Creates an new instance. public ServicesPatchDescription() @@ -52,18 +52,25 @@ public partial interface IServicesPatchDescription : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } /// Instance tags [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Instance tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags Tag { get; set; } } /// The description of the service. @@ -71,13 +78,14 @@ internal partial interface IServicesPatchDescriptionInternal { /// The properties for updating a service instance. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParameters Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParameters Property { get; set; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } /// Instance tags - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags Tag { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescription.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescription.json.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescription.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescription.json.cs index 412a82b53a80..76bf36f6fcf4 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescription.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescription.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServicesPatchDescription partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescription. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescription. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescription. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescription. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescription FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescription FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServicesPatchDescription(json) : null; } @@ -77,8 +77,8 @@ internal ServicesPatchDescription(Microsoft.Azure.PowerShell.Cmdlets.HealthcareA { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesPropertiesUpdateParameters.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesPatchDescriptionTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesPropertiesUpdateParameters.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesPatchDescriptionTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescriptionTags.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescriptionTags.PowerShell.cs similarity index 80% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescriptionTags.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescriptionTags.PowerShell.cs index 68a4d3ebd38a..b44e1c3c8ab5 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescriptionTags.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescriptionTags.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ServicesPatchDescriptionTags partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServicesPatchDescriptionTags(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.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServicesPatchDescriptionTags(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. @@ -109,7 +115,7 @@ internal ServicesPatchDescriptionTags(global::System.Collections.IDictionary con } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -131,6 +137,18 @@ internal ServicesPatchDescriptionTags(global::System.Management.Automation.PSObj /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Instance tags [System.ComponentModel.TypeConverter(typeof(ServicesPatchDescriptionTagsTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescriptionTags.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescriptionTags.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescriptionTags.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescriptionTags.TypeConverter.cs index cee54f87780c..4ddade1a04f7 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescriptionTags.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescriptionTags.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescriptionTags.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescriptionTags.cs similarity index 91% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescriptionTags.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescriptionTags.cs index 53bb38ee2fe1..bc3b1cb5b7be 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescriptionTags.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescriptionTags.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Instance tags public partial class ServicesPatchDescriptionTags : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTagsInternal { /// Creates an new instance. diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescriptionTags.dictionary.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescriptionTags.dictionary.cs similarity index 96% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescriptionTags.dictionary.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescriptionTags.dictionary.cs index 10ee0b2f5bb8..17dc9ee4e320 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescriptionTags.dictionary.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescriptionTags.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.ServicesPatchDescriptionTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesPatchDescriptionTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescriptionTags.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescriptionTags.json.cs similarity index 95% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescriptionTags.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescriptionTags.json.cs index c26cc1579558..9dbcf5fc7b76 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPatchDescriptionTags.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPatchDescriptionTags.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServicesPatchDescriptionTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServicesPatchDescriptionTags(json) : null; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesProperties.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesProperties.PowerShell.cs new file mode 100644 index 000000000000..4f685f3c5952 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesProperties.PowerShell.cs @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + + /// The properties of a service instance. + [System.ComponentModel.TypeConverter(typeof(ServicesPropertiesTypeConverter))] + public partial class ServicesProperties + { + + /// + /// 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.HealthcareApis.Models.IServicesProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ServicesProperties(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.HealthcareApis.Models.IServicesProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ServicesProperties(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.HealthcareApis.Models.IServicesProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ServicesProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CosmosDbConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CosmosDbConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo) content.GetValueForProperty("CosmosDbConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CosmosDbConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceCosmosDbConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AuthenticationConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAuthenticationConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("CorsConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorsConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo) content.GetValueForProperty("CorsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorsConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceCorsConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExportConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).ExportConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo) content.GetValueForProperty("ExportConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).ExportConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceExportConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AcrConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AcrConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo) content.GetValueForProperty("AcrConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AcrConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAcrConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("AccessPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AccessPolicy = (System.Collections.Generic.List) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AccessPolicy, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAccessPolicyEntryTypeConverter.ConvertFrom)); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).PublicNetworkAccess, global::System.Convert.ToString); + } + if (content.Contains("CosmoDbConfigurationOfferThroughput")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CosmoDbConfigurationOfferThroughput = (int?) content.GetValueForProperty("CosmoDbConfigurationOfferThroughput",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CosmoDbConfigurationOfferThroughput, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CosmoDbConfigurationKeyVaultKeyUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CosmoDbConfigurationKeyVaultKeyUri = (string) content.GetValueForProperty("CosmoDbConfigurationKeyVaultKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CosmoDbConfigurationKeyVaultKeyUri, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationAudience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AuthenticationConfigurationAudience = (string) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AuthenticationConfigurationAudience, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationSmartProxyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AuthenticationConfigurationSmartProxyEnabled = (bool?) content.GetValueForProperty("AuthenticationConfigurationSmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AuthenticationConfigurationSmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CorConfigurationOrigin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationOrigin = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationOrigin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationOrigin, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationHeader = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationHeader",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationHeader, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationMethod = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationMethod",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationMethod, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationMaxAge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationMaxAge = (int?) content.GetValueForProperty("CorConfigurationMaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationMaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CorConfigurationAllowCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationAllowCredentials = (bool?) content.GetValueForProperty("CorConfigurationAllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationAllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExportConfigurationStorageAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).ExportConfigurationStorageAccountName = (string) content.GetValueForProperty("ExportConfigurationStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).ExportConfigurationStorageAccountName, global::System.Convert.ToString); + } + if (content.Contains("AcrConfigurationLoginServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AcrConfigurationLoginServer = (System.Collections.Generic.List) content.GetValueForProperty("AcrConfigurationLoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AcrConfigurationLoginServer, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AcrConfigurationOciArtifact")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AcrConfigurationOciArtifact = (System.Collections.Generic.List) content.GetValueForProperty("AcrConfigurationOciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AcrConfigurationOciArtifact, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ServicesProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CosmosDbConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CosmosDbConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo) content.GetValueForProperty("CosmosDbConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CosmosDbConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceCosmosDbConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AuthenticationConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AuthenticationConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo) content.GetValueForProperty("AuthenticationConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AuthenticationConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAuthenticationConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("CorsConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorsConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo) content.GetValueForProperty("CorsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorsConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceCorsConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExportConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).ExportConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo) content.GetValueForProperty("ExportConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).ExportConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceExportConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("AcrConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AcrConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo) content.GetValueForProperty("AcrConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AcrConfiguration, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAcrConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("AccessPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AccessPolicy = (System.Collections.Generic.List) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AccessPolicy, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAccessPolicyEntryTypeConverter.ConvertFrom)); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).PublicNetworkAccess, global::System.Convert.ToString); + } + if (content.Contains("CosmoDbConfigurationOfferThroughput")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CosmoDbConfigurationOfferThroughput = (int?) content.GetValueForProperty("CosmoDbConfigurationOfferThroughput",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CosmoDbConfigurationOfferThroughput, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CosmoDbConfigurationKeyVaultKeyUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CosmoDbConfigurationKeyVaultKeyUri = (string) content.GetValueForProperty("CosmoDbConfigurationKeyVaultKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CosmoDbConfigurationKeyVaultKeyUri, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AuthenticationConfigurationAuthority = (string) content.GetValueForProperty("AuthenticationConfigurationAuthority",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AuthenticationConfigurationAuthority, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationAudience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AuthenticationConfigurationAudience = (string) content.GetValueForProperty("AuthenticationConfigurationAudience",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AuthenticationConfigurationAudience, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationConfigurationSmartProxyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AuthenticationConfigurationSmartProxyEnabled = (bool?) content.GetValueForProperty("AuthenticationConfigurationSmartProxyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AuthenticationConfigurationSmartProxyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CorConfigurationOrigin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationOrigin = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationOrigin",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationOrigin, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationHeader = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationHeader",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationHeader, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationMethod = (System.Collections.Generic.List) content.GetValueForProperty("CorConfigurationMethod",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationMethod, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CorConfigurationMaxAge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationMaxAge = (int?) content.GetValueForProperty("CorConfigurationMaxAge",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationMaxAge, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CorConfigurationAllowCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationAllowCredentials = (bool?) content.GetValueForProperty("CorConfigurationAllowCredentials",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).CorConfigurationAllowCredentials, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExportConfigurationStorageAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).ExportConfigurationStorageAccountName = (string) content.GetValueForProperty("ExportConfigurationStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).ExportConfigurationStorageAccountName, global::System.Convert.ToString); + } + if (content.Contains("AcrConfigurationLoginServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AcrConfigurationLoginServer = (System.Collections.Generic.List) content.GetValueForProperty("AcrConfigurationLoginServer",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AcrConfigurationLoginServer, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AcrConfigurationOciArtifact")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AcrConfigurationOciArtifact = (System.Collections.Generic.List) content.GetValueForProperty("AcrConfigurationOciArtifact",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal)this).AcrConfigurationOciArtifact, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceOciArtifactEntryTypeConverter.ConvertFrom)); + } + 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.HealthcareApis.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 service instance. + [System.ComponentModel.TypeConverter(typeof(ServicesPropertiesTypeConverter))] + public partial interface IServicesProperties + + { + + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesProperties.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesProperties.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesProperties.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesProperties.TypeConverter.cs index 7ff262836d0b..b9ae8dc8d059 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesProperties.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServicesProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesProperties.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesProperties.cs similarity index 59% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesProperties.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesProperties.cs index c971ae4f2133..bf54b6542386 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesProperties.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesProperties.cs @@ -3,152 +3,152 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The properties of a service instance. public partial class ServicesProperties : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesProperties, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesProperties, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry[] _accessPolicy; + private System.Collections.Generic.List _accessPolicy; /// The access policies of the service instance. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry[] AccessPolicy { get => this._accessPolicy; set => this._accessPolicy = value; } + public System.Collections.Generic.List AccessPolicy { get => this._accessPolicy; set => this._accessPolicy = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo _acrConfiguration; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo _acrConfiguration; /// /// The azure container registry settings used for convert data operation of the service instance. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo AcrConfiguration { get => (this._acrConfiguration = this._acrConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAcrConfigurationInfo()); set => this._acrConfiguration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo AcrConfiguration { get => (this._acrConfiguration = this._acrConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAcrConfigurationInfo()); set => this._acrConfiguration = value; } /// The list of the ACR login servers. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string[] AcrConfigurationLoginServer { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfoInternal)AcrConfiguration).LoginServer; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfoInternal)AcrConfiguration).LoginServer = value ?? null /* arrayOf */; } + public System.Collections.Generic.List AcrConfigurationLoginServer { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfoInternal)AcrConfiguration).LoginServer; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfoInternal)AcrConfiguration).LoginServer = value ?? null /* arrayOf */; } /// The list of Open Container Initiative (OCI) artifacts. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfoInternal)AcrConfiguration).OciArtifact; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfoInternal)AcrConfiguration).OciArtifact = value ?? null /* arrayOf */; } + public System.Collections.Generic.List AcrConfigurationOciArtifact { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfoInternal)AcrConfiguration).OciArtifact; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfoInternal)AcrConfiguration).OciArtifact = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo _authenticationConfiguration; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo _authenticationConfiguration; /// The authentication configuration for the service instance. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo AuthenticationConfiguration { get => (this._authenticationConfiguration = this._authenticationConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAuthenticationConfigurationInfo()); set => this._authenticationConfiguration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo AuthenticationConfiguration { get => (this._authenticationConfiguration = this._authenticationConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAuthenticationConfigurationInfo()); set => this._authenticationConfiguration = value; } /// The audience url for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string AuthenticationConfigurationAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal)AuthenticationConfiguration).Audience; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal)AuthenticationConfiguration).Audience = value ?? null; } + public string AuthenticationConfigurationAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal)AuthenticationConfiguration).Audience; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal)AuthenticationConfiguration).Audience = value ?? null; } /// The authority url for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string AuthenticationConfigurationAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal)AuthenticationConfiguration).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal)AuthenticationConfiguration).Authority = value ?? null; } + public string AuthenticationConfigurationAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal)AuthenticationConfiguration).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal)AuthenticationConfiguration).Authority = value ?? null; } /// If the SMART on FHIR proxy is enabled [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public bool? AuthenticationConfigurationSmartProxyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal)AuthenticationConfiguration).SmartProxyEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfoInternal)AuthenticationConfiguration).SmartProxyEnabled = value ?? default(bool); } + public bool? AuthenticationConfigurationSmartProxyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal)AuthenticationConfiguration).SmartProxyEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfoInternal)AuthenticationConfiguration).SmartProxyEnabled = value ?? default(bool); } /// If credentials are allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public bool? CorConfigurationAllowCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)CorsConfiguration).AllowCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)CorsConfiguration).AllowCredentials = value ?? default(bool); } + public bool? CorConfigurationAllowCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)CorsConfiguration).AllowCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)CorsConfiguration).AllowCredentials = value ?? default(bool); } /// The headers to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string[] CorConfigurationHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)CorsConfiguration).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)CorsConfiguration).Header = value ?? null /* arrayOf */; } + public System.Collections.Generic.List CorConfigurationHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)CorsConfiguration).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)CorsConfiguration).Header = value ?? null /* arrayOf */; } /// The max age to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public int? CorConfigurationMaxAge { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)CorsConfiguration).MaxAge; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)CorsConfiguration).MaxAge = value ?? default(int); } + public int? CorConfigurationMaxAge { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)CorsConfiguration).MaxAge; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)CorsConfiguration).MaxAge = value ?? default(int); } /// The methods to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string[] CorConfigurationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)CorsConfiguration).Method; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)CorsConfiguration).Method = value ?? null /* arrayOf */; } + public System.Collections.Generic.List CorConfigurationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)CorsConfiguration).Method; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)CorsConfiguration).Method = value ?? null /* arrayOf */; } /// The origins to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string[] CorConfigurationOrigin { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)CorsConfiguration).Origin; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfoInternal)CorsConfiguration).Origin = value ?? null /* arrayOf */; } + public System.Collections.Generic.List CorConfigurationOrigin { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)CorsConfiguration).Origin; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfoInternal)CorsConfiguration).Origin = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo _corsConfiguration; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo _corsConfiguration; /// The settings for the CORS configuration of the service instance. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo CorsConfiguration { get => (this._corsConfiguration = this._corsConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceCorsConfigurationInfo()); set => this._corsConfiguration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo CorsConfiguration { get => (this._corsConfiguration = this._corsConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceCorsConfigurationInfo()); set => this._corsConfiguration = value; } /// The URI of the customer-managed key for the backing database. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string CosmoDbConfigurationKeyVaultKeyUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfoInternal)CosmosDbConfiguration).KeyVaultKeyUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfoInternal)CosmosDbConfiguration).KeyVaultKeyUri = value ?? null; } + public string CosmoDbConfigurationKeyVaultKeyUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfoInternal)CosmosDbConfiguration).KeyVaultKeyUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfoInternal)CosmosDbConfiguration).KeyVaultKeyUri = value ?? null; } /// The provisioned throughput for the backing database. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public int? CosmoDbConfigurationOfferThroughput { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfoInternal)CosmosDbConfiguration).OfferThroughput; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfoInternal)CosmosDbConfiguration).OfferThroughput = value ?? default(int); } + public int? CosmoDbConfigurationOfferThroughput { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfoInternal)CosmosDbConfiguration).OfferThroughput; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfoInternal)CosmosDbConfiguration).OfferThroughput = value ?? default(int); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo _cosmosDbConfiguration; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo _cosmosDbConfiguration; /// The settings for the Cosmos DB database backing the service. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo CosmosDbConfiguration { get => (this._cosmosDbConfiguration = this._cosmosDbConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceCosmosDbConfigurationInfo()); set => this._cosmosDbConfiguration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo CosmosDbConfiguration { get => (this._cosmosDbConfiguration = this._cosmosDbConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceCosmosDbConfigurationInfo()); set => this._cosmosDbConfiguration = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo _exportConfiguration; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo _exportConfiguration; /// The settings for the export operation of the service instance. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo ExportConfiguration { get => (this._exportConfiguration = this._exportConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceExportConfigurationInfo()); set => this._exportConfiguration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo ExportConfiguration { get => (this._exportConfiguration = this._exportConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceExportConfigurationInfo()); set => this._exportConfiguration = value; } /// The name of the default export storage account. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string ExportConfigurationStorageAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfoInternal)ExportConfiguration).StorageAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfoInternal)ExportConfiguration).StorageAccountName = value ?? null; } + public string ExportConfigurationStorageAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfoInternal)ExportConfiguration).StorageAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfoInternal)ExportConfiguration).StorageAccountName = value ?? null; } /// Internal Acessors for AcrConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal.AcrConfiguration { get => (this._acrConfiguration = this._acrConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAcrConfigurationInfo()); set { {_acrConfiguration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal.AcrConfiguration { get => (this._acrConfiguration = this._acrConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAcrConfigurationInfo()); set { {_acrConfiguration = value;} } } /// Internal Acessors for AuthenticationConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal.AuthenticationConfiguration { get => (this._authenticationConfiguration = this._authenticationConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAuthenticationConfigurationInfo()); set { {_authenticationConfiguration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal.AuthenticationConfiguration { get => (this._authenticationConfiguration = this._authenticationConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAuthenticationConfigurationInfo()); set { {_authenticationConfiguration = value;} } } /// Internal Acessors for CorsConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal.CorsConfiguration { get => (this._corsConfiguration = this._corsConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceCorsConfigurationInfo()); set { {_corsConfiguration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal.CorsConfiguration { get => (this._corsConfiguration = this._corsConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceCorsConfigurationInfo()); set { {_corsConfiguration = value;} } } /// Internal Acessors for CosmosDbConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal.CosmosDbConfiguration { get => (this._cosmosDbConfiguration = this._cosmosDbConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceCosmosDbConfigurationInfo()); set { {_cosmosDbConfiguration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal.CosmosDbConfiguration { get => (this._cosmosDbConfiguration = this._cosmosDbConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceCosmosDbConfigurationInfo()); set { {_cosmosDbConfiguration = value;} } } /// Internal Acessors for ExportConfiguration - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal.ExportConfiguration { get => (this._exportConfiguration = this._exportConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceExportConfigurationInfo()); set { {_exportConfiguration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal.ExportConfiguration { get => (this._exportConfiguration = this._exportConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceExportConfigurationInfo()); set { {_exportConfiguration = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] _privateEndpointConnection; + private System.Collections.Generic.List _privateEndpointConnection; /// The list of private endpoint connections that are set up for this resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get => this._privateEndpointConnection; set => this._privateEndpointConnection = value; } + public System.Collections.Generic.List PrivateEndpointConnection { get => this._privateEndpointConnection; set => this._privateEndpointConnection = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? _publicNetworkAccess; + private string _publicNetworkAccess; /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } + public string PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } /// Creates an new instance. public ServicesProperties() @@ -164,30 +164,42 @@ public partial interface IServicesProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The access policies of the service instance.", SerializedName = @"accessPolicies", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry[] AccessPolicy { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntry) })] + System.Collections.Generic.List AccessPolicy { get; set; } /// The list of the ACR login servers. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of the ACR login servers.", SerializedName = @"loginServers", PossibleTypes = new [] { typeof(string) })] - string[] AcrConfigurationLoginServer { get; set; } + System.Collections.Generic.List AcrConfigurationLoginServer { get; set; } /// The list of Open Container Initiative (OCI) artifacts. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Open Container Initiative (OCI) artifacts.", SerializedName = @"ociArtifacts", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry) })] + System.Collections.Generic.List AcrConfigurationOciArtifact { get; set; } /// The audience url for the service [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The audience url for the service", SerializedName = @"audience", PossibleTypes = new [] { typeof(string) })] @@ -196,6 +208,9 @@ public partial interface IServicesProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The authority url for the service", SerializedName = @"authority", PossibleTypes = new [] { typeof(string) })] @@ -204,6 +219,9 @@ public partial interface IServicesProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If the SMART on FHIR proxy is enabled", SerializedName = @"smartProxyEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -212,6 +230,9 @@ public partial interface IServicesProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If credentials are allowed via CORS.", SerializedName = @"allowCredentials", PossibleTypes = new [] { typeof(bool) })] @@ -220,14 +241,20 @@ public partial interface IServicesProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The headers to be allowed via CORS.", SerializedName = @"headers", PossibleTypes = new [] { typeof(string) })] - string[] CorConfigurationHeader { get; set; } + System.Collections.Generic.List CorConfigurationHeader { get; set; } /// The max age to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The max age to be allowed via CORS.", SerializedName = @"maxAge", PossibleTypes = new [] { typeof(int) })] @@ -236,22 +263,31 @@ public partial interface IServicesProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The methods to be allowed via CORS.", SerializedName = @"methods", PossibleTypes = new [] { typeof(string) })] - string[] CorConfigurationMethod { get; set; } + System.Collections.Generic.List CorConfigurationMethod { get; set; } /// The origins to be allowed via CORS. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The origins to be allowed via CORS.", SerializedName = @"origins", PossibleTypes = new [] { typeof(string) })] - string[] CorConfigurationOrigin { get; set; } + System.Collections.Generic.List CorConfigurationOrigin { get; set; } /// The URI of the customer-managed key for the backing database. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URI of the customer-managed key for the backing database.", SerializedName = @"keyVaultKeyUri", PossibleTypes = new [] { typeof(string) })] @@ -260,6 +296,9 @@ public partial interface IServicesProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The provisioned throughput for the backing database.", SerializedName = @"offerThroughput", PossibleTypes = new [] { typeof(int) })] @@ -268,6 +307,9 @@ public partial interface IServicesProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the default export storage account.", SerializedName = @"storageAccountName", PossibleTypes = new [] { typeof(string) })] @@ -276,28 +318,39 @@ public partial interface IServicesProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of private endpoint connections that are set up for this resource.", SerializedName = @"privateEndpointConnections", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection) })] + System.Collections.Generic.List PrivateEndpointConnection { get; set; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } } /// The properties of a service instance. @@ -305,17 +358,17 @@ internal partial interface IServicesPropertiesInternal { /// The access policies of the service instance. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry[] AccessPolicy { get; set; } + System.Collections.Generic.List AccessPolicy { get; set; } /// /// The azure container registry settings used for convert data operation of the service instance. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAcrConfigurationInfo AcrConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAcrConfigurationInfo AcrConfiguration { get; set; } /// The list of the ACR login servers. - string[] AcrConfigurationLoginServer { get; set; } + System.Collections.Generic.List AcrConfigurationLoginServer { get; set; } /// The list of Open Container Initiative (OCI) artifacts. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get; set; } + System.Collections.Generic.List AcrConfigurationOciArtifact { get; set; } /// The authentication configuration for the service instance. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAuthenticationConfigurationInfo AuthenticationConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAuthenticationConfigurationInfo AuthenticationConfiguration { get; set; } /// The audience url for the service string AuthenticationConfigurationAudience { get; set; } /// The authority url for the service @@ -325,33 +378,35 @@ internal partial interface IServicesPropertiesInternal /// If credentials are allowed via CORS. bool? CorConfigurationAllowCredentials { get; set; } /// The headers to be allowed via CORS. - string[] CorConfigurationHeader { get; set; } + System.Collections.Generic.List CorConfigurationHeader { get; set; } /// The max age to be allowed via CORS. int? CorConfigurationMaxAge { get; set; } /// The methods to be allowed via CORS. - string[] CorConfigurationMethod { get; set; } + System.Collections.Generic.List CorConfigurationMethod { get; set; } /// The origins to be allowed via CORS. - string[] CorConfigurationOrigin { get; set; } + System.Collections.Generic.List CorConfigurationOrigin { get; set; } /// The settings for the CORS configuration of the service instance. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCorsConfigurationInfo CorsConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCorsConfigurationInfo CorsConfiguration { get; set; } /// The URI of the customer-managed key for the backing database. string CosmoDbConfigurationKeyVaultKeyUri { get; set; } /// The provisioned throughput for the backing database. int? CosmoDbConfigurationOfferThroughput { get; set; } /// The settings for the Cosmos DB database backing the service. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceCosmosDbConfigurationInfo CosmosDbConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceCosmosDbConfigurationInfo CosmosDbConfiguration { get; set; } /// The settings for the export operation of the service instance. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceExportConfigurationInfo ExportConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceExportConfigurationInfo ExportConfiguration { get; set; } /// The name of the default export storage account. string ExportConfigurationStorageAccountName { get; set; } /// The list of private endpoint connections that are set up for this resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + System.Collections.Generic.List PrivateEndpointConnection { get; set; } /// The provisioning state. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; set; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesProperties.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesProperties.json.cs similarity index 83% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesProperties.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesProperties.json.cs index 536a5ab32020..2fea4048ef35 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesProperties.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServicesProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServicesProperties(json) : null; } @@ -77,15 +77,15 @@ internal ServicesProperties(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Ru { return; } - {_cosmosDbConfiguration = If( json?.PropertyT("cosmosDbConfiguration"), out var __jsonCosmosDbConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceCosmosDbConfigurationInfo.FromJson(__jsonCosmosDbConfiguration) : CosmosDbConfiguration;} - {_authenticationConfiguration = If( json?.PropertyT("authenticationConfiguration"), out var __jsonAuthenticationConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAuthenticationConfigurationInfo.FromJson(__jsonAuthenticationConfiguration) : AuthenticationConfiguration;} - {_corsConfiguration = If( json?.PropertyT("corsConfiguration"), out var __jsonCorsConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceCorsConfigurationInfo.FromJson(__jsonCorsConfiguration) : CorsConfiguration;} - {_exportConfiguration = If( json?.PropertyT("exportConfiguration"), out var __jsonExportConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceExportConfigurationInfo.FromJson(__jsonExportConfiguration) : ExportConfiguration;} - {_acrConfiguration = If( json?.PropertyT("acrConfiguration"), out var __jsonAcrConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAcrConfigurationInfo.FromJson(__jsonAcrConfiguration) : AcrConfiguration;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_accessPolicy = If( json?.PropertyT("accessPolicies"), out var __jsonAccessPolicies) ? If( __jsonAccessPolicies as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServiceAccessPolicyEntry.FromJson(__u) )) ))() : null : AccessPolicy;} - {_privateEndpointConnection = If( json?.PropertyT("privateEndpointConnections"), out var __jsonPrivateEndpointConnections) ? If( __jsonPrivateEndpointConnections as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api10.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnection.FromJson(__p) )) ))() : null : PrivateEndpointConnection;} - {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)PublicNetworkAccess;} + {_cosmosDbConfiguration = If( json?.PropertyT("cosmosDbConfiguration"), out var __jsonCosmosDbConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceCosmosDbConfigurationInfo.FromJson(__jsonCosmosDbConfiguration) : _cosmosDbConfiguration;} + {_authenticationConfiguration = If( json?.PropertyT("authenticationConfiguration"), out var __jsonAuthenticationConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAuthenticationConfigurationInfo.FromJson(__jsonAuthenticationConfiguration) : _authenticationConfiguration;} + {_corsConfiguration = If( json?.PropertyT("corsConfiguration"), out var __jsonCorsConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceCorsConfigurationInfo.FromJson(__jsonCorsConfiguration) : _corsConfiguration;} + {_exportConfiguration = If( json?.PropertyT("exportConfiguration"), out var __jsonExportConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceExportConfigurationInfo.FromJson(__jsonExportConfiguration) : _exportConfiguration;} + {_acrConfiguration = If( json?.PropertyT("acrConfiguration"), out var __jsonAcrConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAcrConfigurationInfo.FromJson(__jsonAcrConfiguration) : _acrConfiguration;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_accessPolicy = If( json?.PropertyT("accessPolicies"), out var __jsonAccessPolicies) ? If( __jsonAccessPolicies as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IServiceAccessPolicyEntry) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServiceAccessPolicyEntry.FromJson(__u) )) ))() : null : _accessPolicy;} + {_privateEndpointConnection = If( json?.PropertyT("privateEndpointConnections"), out var __jsonPrivateEndpointConnections) ? If( __jsonPrivateEndpointConnections as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnection.FromJson(__p) )) ))() : null : _privateEndpointConnection;} + {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)_publicNetworkAccess;} AfterFromJson(json); } @@ -113,7 +113,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T AddIf( null != this._corsConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._corsConfiguration.ToJson(null,serializationMode) : null, "corsConfiguration" ,container.Add ); AddIf( null != this._exportConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._exportConfiguration.ToJson(null,serializationMode) : null, "exportConfiguration" ,container.Add ); AddIf( null != this._acrConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._acrConfiguration.ToJson(null,serializationMode) : null, "acrConfiguration" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPropertiesUpdateParameters.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPropertiesUpdateParameters.PowerShell.cs similarity index 75% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPropertiesUpdateParameters.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPropertiesUpdateParameters.PowerShell.cs index 37848799eaee..f08c42842a28 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPropertiesUpdateParameters.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPropertiesUpdateParameters.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class ServicesPropertiesUpdateParameters partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServicesPropertiesUpdateParameters(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 . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServicesPropertiesUpdateParameters(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -107,13 +115,13 @@ internal ServicesPropertiesUpdateParameters(global::System.Collections.IDictiona // actually deserialize if (content.Contains("PublicNetworkAccess")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParametersInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParametersInternal)this).PublicNetworkAccess, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -128,7 +136,7 @@ internal ServicesPropertiesUpdateParameters(global::System.Management.Automation // actually deserialize if (content.Contains("PublicNetworkAccess")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParametersInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParametersInternal)this).PublicNetworkAccess, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -137,6 +145,18 @@ internal ServicesPropertiesUpdateParameters(global::System.Management.Automation /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 for updating a service instance. [System.ComponentModel.TypeConverter(typeof(ServicesPropertiesUpdateParametersTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPropertiesUpdateParameters.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPropertiesUpdateParameters.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPropertiesUpdateParameters.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPropertiesUpdateParameters.TypeConverter.cs index dae6869fe46a..fbfdf5f31f33 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPropertiesUpdateParameters.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPropertiesUpdateParameters.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPropertiesUpdateParameters.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPropertiesUpdateParameters.cs similarity index 74% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPropertiesUpdateParameters.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPropertiesUpdateParameters.cs index ccf804a898b7..8ef28831d7a8 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPropertiesUpdateParameters.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPropertiesUpdateParameters.cs @@ -3,24 +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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The properties for updating a service instance. public partial class ServicesPropertiesUpdateParameters : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParameters, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParametersInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParametersInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? _publicNetworkAccess; + private string _publicNetworkAccess; /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } + public string PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } /// Creates an new instance. public ServicesPropertiesUpdateParameters() @@ -38,10 +38,14 @@ public partial interface IServicesPropertiesUpdateParameters : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } } /// The properties for updating a service instance. @@ -51,7 +55,8 @@ internal partial interface IServicesPropertiesUpdateParametersInternal /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPropertiesUpdateParameters.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPropertiesUpdateParameters.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPropertiesUpdateParameters.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPropertiesUpdateParameters.json.cs index 2aa064808620..45c80762efcf 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesPropertiesUpdateParameters.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesPropertiesUpdateParameters.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServicesPropertiesUpdateParameters partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPropertiesUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPropertiesUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServicesPropertiesUpdateParameters(json) : null; } @@ -77,7 +77,7 @@ internal ServicesPropertiesUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.H { return; } - {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)PublicNetworkAccess;} + {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)_publicNetworkAccess;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResource.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResource.PowerShell.cs similarity index 55% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResource.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResource.PowerShell.cs index 8d3f95b8f137..1f1114798757 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResource.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class ServicesResource partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServicesResource(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.HealthcareApis.Models.Api20211101.IServicesResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServicesResource(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,53 +111,53 @@ internal ServicesResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Identity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResourceIdentityTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResourceIdentityTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Kind")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Kind, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("IdentityPrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); } if (content.Contains("IdentityTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); } if (content.Contains("IdentityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityType, 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. @@ -164,47 +172,47 @@ internal ServicesResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Identity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResourceIdentityTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResourceIdentityTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Kind")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Kind, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("IdentityPrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); } if (content.Contains("IdentityTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); } if (content.Contains("IdentityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal)this).IdentityType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -213,6 +221,18 @@ internal ServicesResource(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 common properties of a service. [System.ComponentModel.TypeConverter(typeof(ServicesResourceTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResource.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResource.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResource.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResource.TypeConverter.cs index 0924eefa2cdb..6a7d698350b0 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResource.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServicesResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResource.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResource.cs similarity index 73% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResource.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResource.cs index 2d82cd90303d..4fe5438dc6d3 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResource.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The common properties of a service. public partial class ServicesResource : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResource, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResource, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal { /// Backing field for property. @@ -30,34 +30,34 @@ public partial class ServicesResource : public string Id { get => this._id; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentity _identity; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity _identity; /// /// Setting indicating whether the service has a managed identity associated with it. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResourceIdentity()); set => this._identity = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResourceIdentity()); set => this._identity = value; } /// The principal ID of the resource identity. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)Identity).PrincipalId; } + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)Identity).PrincipalId; } /// The tenant ID of the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)Identity).TenantId; } + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)Identity).TenantId; } /// /// Type of identity being specified, currently SystemAssigned and None are allowed. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType)""); } + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)Identity).Type = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind _kind; + private string _kind; /// The kind of the service. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind Kind { get => this._kind; set => this._kind = value; } + public string Kind { get => this._kind; set => this._kind = value; } /// Backing field for property. private string _location; @@ -67,22 +67,22 @@ public partial class ServicesResource : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Identity - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentity Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResourceIdentity()); set { {_identity = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResourceIdentity()); set { {_identity = value;} } } /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)Identity).PrincipalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)Identity).PrincipalId = value ?? null; } /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)Identity).TenantId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)Identity).TenantId = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -92,11 +92,11 @@ public partial class ServicesResource : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags _tag; /// The resource tags. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResourceTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResourceTags()); set => this._tag = value; } /// Backing field for property. private string _type; @@ -121,6 +121,9 @@ public partial interface IServicesResource : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", SerializedName = @"etag", PossibleTypes = new [] { typeof(string) })] @@ -129,6 +132,9 @@ public partial interface IServicesResource : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The resource identifier.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -137,6 +143,9 @@ public partial interface IServicesResource : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The principal ID of the resource identity.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -145,6 +154,9 @@ public partial interface IServicesResource : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The tenant ID of the resource.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -155,22 +167,33 @@ public partial interface IServicesResource : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of identity being specified, currently SystemAssigned and None are allowed.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType? IdentityType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("SystemAssigned", "None")] + string IdentityType { get; set; } /// The kind of the service. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The kind of the service.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind Kind { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir", "fhir-Stu3", "fhir-R4")] + string Kind { get; set; } /// The resource location. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The resource location.", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -179,6 +202,9 @@ public partial interface IServicesResource : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The resource name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -187,14 +213,20 @@ public partial interface IServicesResource : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags Tag { get; set; } /// The resource type. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The resource type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -214,7 +246,7 @@ internal partial interface IServicesResourceInternal /// /// Setting indicating whether the service has a managed identity associated with it. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentity Identity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity Identity { get; set; } /// The principal ID of the resource identity. string IdentityPrincipalId { get; set; } /// The tenant ID of the resource. @@ -222,15 +254,17 @@ internal partial interface IServicesResourceInternal /// /// Type of identity being specified, currently SystemAssigned and None are allowed. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType? IdentityType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("SystemAssigned", "None")] + string IdentityType { get; set; } /// The kind of the service. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind Kind { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir", "fhir-Stu3", "fhir-R4")] + string Kind { get; set; } /// The resource location. string Location { get; set; } /// The resource name. string Name { get; set; } /// The resource tags. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags Tag { get; set; } /// The resource type. string Type { get; set; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResource.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResource.json.cs similarity index 88% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResource.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResource.json.cs index 481a5ef4531d..d0793d535bfd 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResource.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServicesResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServicesResource(json) : null; } @@ -77,14 +77,14 @@ internal ServicesResource(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runt { return; } - {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResourceIdentity.FromJson(__jsonIdentity) : Identity;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesResourceTags.FromJson(__jsonTags) : Tag;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResourceIdentity.FromJson(__jsonIdentity) : _identity;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)_kind;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResourceTags.FromJson(__jsonTags) : _tag;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } @@ -108,20 +108,23 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T return container; } AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); - AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + } AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); AfterToJson(ref container); diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceIdentity.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceIdentity.PowerShell.cs similarity index 71% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceIdentity.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceIdentity.PowerShell.cs index d7f1862acb93..9f61e635d783 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceIdentity.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceIdentity.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -57,29 +57,35 @@ public partial class ServicesResourceIdentity partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServicesResourceIdentity(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.HealthcareApis.Models.Api20211101.IServicesResourceIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServicesResourceIdentity(content); } @@ -89,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -107,21 +113,21 @@ internal ServicesResourceIdentity(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("TenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)this).TenantId, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)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,15 +142,15 @@ internal ServicesResourceIdentity(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("TenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)this).TenantId, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -153,6 +159,18 @@ internal ServicesResourceIdentity(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + } } /// Setting indicating whether the service has a managed identity associated with it. [System.ComponentModel.TypeConverter(typeof(ServicesResourceIdentityTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceIdentity.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceIdentity.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceIdentity.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceIdentity.TypeConverter.cs index 65ec6c5554d9..7af0a83f9df5 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceIdentity.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceIdentity.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServicesResourceIdentity ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentity).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceIdentity.cs similarity index 81% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceIdentity.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceIdentity.cs index 6745fe0d2696..cf2e83dcd423 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceIdentity.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -11,15 +11,15 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 /// Setting indicating whether the service has a managed identity associated with it. /// public partial class ServicesResourceIdentity : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentity, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal { /// Internal Acessors for PrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } /// Internal Acessors for TenantId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentityInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentityInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } /// Backing field for property. private string _principalId; @@ -36,13 +36,13 @@ public partial class ServicesResourceIdentity : public string TenantId { get => this._tenantId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType? _type; + private string _type; /// /// Type of identity being specified, currently SystemAssigned and None are allowed. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType? Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Creates an new instance. public ServicesResourceIdentity() @@ -58,6 +58,9 @@ public partial interface IServicesResourceIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The principal ID of the resource identity.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -66,6 +69,9 @@ public partial interface IServicesResourceIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The tenant ID of the resource.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -76,10 +82,14 @@ public partial interface IServicesResourceIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of identity being specified, currently SystemAssigned and None are allowed.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType? Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("SystemAssigned", "None")] + string Type { get; set; } } /// Setting indicating whether the service has a managed identity associated with it. @@ -93,7 +103,8 @@ internal partial interface IServicesResourceIdentityInternal /// /// Type of identity being specified, currently SystemAssigned and None are allowed. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType? Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("SystemAssigned", "None")] + string Type { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceIdentity.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceIdentity.json.cs similarity index 95% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceIdentity.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceIdentity.json.cs index b3404b947dc0..e1b70ef271b2 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceIdentity.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceIdentity.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class ServicesResourceIdentity partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentity. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentity. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServicesResourceIdentity(json) : null; } @@ -79,9 +79,9 @@ internal ServicesResourceIdentity(Microsoft.Azure.PowerShell.Cmdlets.HealthcareA { 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); } @@ -104,11 +104,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceTags.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceTags.PowerShell.cs similarity index 81% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceTags.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceTags.PowerShell.cs index 0218a881d478..a700d6c4538f 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceTags.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceTags.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ServicesResourceTags partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServicesResourceTags(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.HealthcareApis.Models.Api20211101.IServicesResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServicesResourceTags(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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. @@ -109,7 +115,7 @@ internal ServicesResourceTags(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. @@ -131,6 +137,18 @@ internal ServicesResourceTags(global::System.Management.Automation.PSObject cont /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 resource tags. [System.ComponentModel.TypeConverter(typeof(ServicesResourceTagsTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceTags.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceTags.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceTags.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceTags.TypeConverter.cs index 3cf960f5502e..eb2617861feb 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceTags.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceTags.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IServicesResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceTags.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceTags.cs similarity index 92% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceTags.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceTags.cs index 8c40ea5354f6..00c02caa9e4b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceTags.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceTags.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The resource tags. public partial class ServicesResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTagsInternal { /// Creates an new instance. diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceTags.dictionary.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceTags.dictionary.cs similarity index 96% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceTags.dictionary.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceTags.dictionary.cs index 5c9afedfe397..f2fad124de4b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceTags.dictionary.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceTags.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.ServicesResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceTags.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceTags.json.cs similarity index 95% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceTags.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceTags.json.cs index 1759fd2d7756..ccb2ee006b84 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/ServicesResourceTags.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/ServicesResourceTags.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServicesResourceTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new ServicesResourceTags(json) : null; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/SystemData.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/SystemData.PowerShell.cs similarity index 63% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/SystemData.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/SystemData.PowerShell.cs index a06ba608807a..760b21ed062a 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/SystemData.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/SystemData.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class SystemData partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SystemData(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SystemData(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISy /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,33 +111,33 @@ internal SystemData(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("CreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("LastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -144,27 +152,27 @@ internal SystemData(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("CreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("LastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } @@ -173,6 +181,18 @@ internal SystemData(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Metadata pertaining to creation and last modification of the resource. [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/SystemData.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/SystemData.TypeConverter.cs similarity index 98% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/SystemData.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/SystemData.TypeConverter.cs index 11c9721c0eaf..942642b2e382 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/SystemData.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/SystemData.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api10.ISystemData ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/SystemData.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/SystemData.cs similarity index 80% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/SystemData.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/SystemData.cs index 88bc5760e2bb..b44c2b6221cb 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/SystemData.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/SystemData.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Metadata pertaining to creation and last modification of the resource. public partial class SystemData : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal { /// Backing field for property. @@ -28,11 +28,11 @@ public partial class SystemData : public string CreatedBy { get => this._createdBy; set => this._createdBy = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? _createdByType; + private string _createdByType; /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? CreatedByType { get => this._createdByType; set => this._createdByType = value; } + public string CreatedByType { get => this._createdByType; set => this._createdByType = value; } /// Backing field for property. private global::System.DateTime? _lastModifiedAt; @@ -49,11 +49,11 @@ public partial class SystemData : public string LastModifiedBy { get => this._lastModifiedBy; set => this._lastModifiedBy = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? _lastModifiedByType; + private string _lastModifiedByType; /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } + public string LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } /// Creates an new instance. public SystemData() @@ -69,6 +69,9 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -77,6 +80,9 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] @@ -85,14 +91,21 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? CreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -101,6 +114,9 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] @@ -109,10 +125,14 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? LastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } } /// Metadata pertaining to creation and last modification of the resource. @@ -124,13 +144,15 @@ internal partial interface ISystemDataInternal /// The identity that created the resource. string CreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? CreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? LastModifiedAt { get; set; } /// The identity that last modified the resource. string LastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? LastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/SystemData.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/SystemData.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/SystemData.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/SystemData.json.cs index 2db6051df0ae..375b86ab3a92 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api10/SystemData.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/SystemData.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SystemData partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new SystemData(json) : null; } @@ -77,12 +77,12 @@ internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Js { return; } - {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)CreatedBy;} - {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)CreatedByType;} - {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : CreatedAt : CreatedAt;} - {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)LastModifiedBy;} - {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)LastModifiedByType;} - {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : LastModifiedAt : LastModifiedAt;} + {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)_createdBy;} + {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)_createdByType;} + {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : _createdAt : _createdAt;} + {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)_lastModifiedBy;} + {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)_lastModifiedByType;} + {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : _lastModifiedAt : _lastModifiedAt;} AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/TaggedResource.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/TaggedResource.PowerShell.cs similarity index 65% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/TaggedResource.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/TaggedResource.PowerShell.cs index 0d6c4363c2d3..95c95b0bfabe 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/TaggedResource.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/TaggedResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class TaggedResource partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new TaggedResource(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.HealthcareApis.Models.Api20211101.ITaggedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TaggedResource(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,33 +111,33 @@ internal TaggedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -144,27 +152,27 @@ internal TaggedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -173,6 +181,18 @@ internal TaggedResource(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 common properties of tracked resources in the service. [System.ComponentModel.TypeConverter(typeof(TaggedResourceTypeConverter))] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/TaggedResource.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/TaggedResource.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/TaggedResource.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/TaggedResource.TypeConverter.cs index d397f003762b..8fab3e8ab681 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/TaggedResource.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/TaggedResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.ITaggedResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/TaggedResource.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/TaggedResource.cs similarity index 63% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/TaggedResource.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/TaggedResource.cs index 42fbc9744a02..803672002407 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/TaggedResource.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/TaggedResource.cs @@ -3,62 +3,62 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// The common properties of tracked resources in the service. public partial class TaggedResource : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResource, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResource, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResource __locationBasedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.LocationBasedResource(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResource __locationBasedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.LocationBasedResource(); /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1 __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTags1(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1 __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTags1(); /// /// An etag associated with the resource, used for optimistic concurrency when editing it. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Etag = value ?? null; } /// The resource identifier. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Id; } /// The resource location. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)__locationBasedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)__locationBasedResource).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)__locationBasedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)__locationBasedResource).Location = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Type = value ?? null; } /// The resource name. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Name; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)__resourceTags1).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)__resourceTags1).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)__resourceTags1).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)__resourceTags1).Tag = value ?? null /* model class */; } /// The resource type. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__locationBasedResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__locationBasedResource).Type; } /// Creates an new instance. public TaggedResource() @@ -83,15 +83,15 @@ public TaggedResource() /// The common properties of tracked resources in the service. public partial interface ITaggedResource : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResource { } /// The common properties of tracked resources in the service. internal partial interface ITaggedResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal { } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/TaggedResource.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/TaggedResource.json.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/TaggedResource.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/TaggedResource.json.cs index 6f8fb665927c..4ee053d6e2a2 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/TaggedResource.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/TaggedResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class TaggedResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new TaggedResource(json) : null; } @@ -77,8 +77,8 @@ internal TaggedResource(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtim { return; } - __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTags1(json); - __locationBasedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.LocationBasedResource(json); + __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTags1(json); + __locationBasedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.LocationBasedResource(json); AfterFromJson(json); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentities.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentities.PowerShell.cs similarity index 82% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentities.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentities.PowerShell.cs index 80c04a804ae9..9451630ed9d4 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentities.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentities.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -59,29 +59,35 @@ public partial class UserAssignedIdentities partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new UserAssignedIdentities(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.HealthcareApis.Models.Api20211101.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new UserAssignedIdentities(content); } @@ -91,15 +97,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -118,7 +136,7 @@ internal UserAssignedIdentities(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentities.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentities.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentities.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentities.TypeConverter.cs index a50eac82e196..56913cfb93da 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentities.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentities.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IUserAssignedIdentities ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentities.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentities.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentities.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentities.cs index fa8e459ec30d..6c107bed4601 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentities.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentities.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -13,8 +13,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 /// The dictionary values can be empty objects ({}) in requests. /// public partial class UserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentitiesInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentitiesInternal { /// Creates an new instance. @@ -28,7 +28,7 @@ public UserAssignedIdentities() /// The dictionary values can be empty objects ({}) in requests. public partial interface IUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray { } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentities.dictionary.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentities.dictionary.cs similarity index 66% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentities.dictionary.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentities.dictionary.cs index aecf6d89498a..1efa38c3555a 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentities.dictionary.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentities.dictionary.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; public partial class UserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray { - protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); - global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } - int Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + int Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentity this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentity this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } /// /// - public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentity value) => __additionalProperties.Add( key, value); + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentity value) => __additionalProperties.Add( key, value); public void Clear() => __additionalProperties.Clear(); @@ -40,7 +40,7 @@ public void CopyFrom(global::System.Collections.IDictionary source) { if ((null != property.Key && null != property.Value)) { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); } } } @@ -55,7 +55,7 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) { if ((null != property.Key && null != property.Value)) { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); } } } @@ -66,10 +66,10 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// /// - public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentity value) => __additionalProperties.TryGetValue( key, out value); + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentity value) => __additionalProperties.TryGetValue( key, out value); /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentities source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentities source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentities.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentities.json.cs similarity index 91% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentities.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentities.json.cs index 50e67e88b00d..d8b0fa57d179 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentities.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentities.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -58,13 +58,13 @@ public partial class UserAssignedIdentities partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new UserAssignedIdentities(json) : null; } @@ -88,7 +88,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T { return container; } - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray)this).AdditionalProperties, container); + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray)this).AdditionalProperties, container); AfterToJson(ref container); return container; } @@ -106,7 +106,7 @@ internal UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApi { return; } - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.UserAssignedIdentity.FromJson(j) ,exclusions ); + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); AfterFromJson(json); } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentity.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentity.PowerShell.cs similarity index 73% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentity.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentity.PowerShell.cs index d71ae607c39c..963566e0d819 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentity.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentity.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class UserAssignedIdentity partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new UserAssignedIdentity(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.HealthcareApis.Models.Api20211101.IUserAssignedIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new UserAssignedIdentity(content); } @@ -87,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -110,17 +128,17 @@ internal UserAssignedIdentity(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentityInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("ClientId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentityInternal)this).ClientId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentityInternal)this).ClientId, 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,11 +153,11 @@ internal UserAssignedIdentity(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentityInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("ClientId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentityInternal)this).ClientId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentityInternal)this).ClientId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentity.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentity.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentity.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentity.TypeConverter.cs index b479c85f9aed..1a2e7424340a 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentity.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentity.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IUserAssignedIdentity ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentity ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentity).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentity).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentity.cs similarity index 88% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentity.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentity.cs index 7ece359d28ac..7430a12f99c2 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentity.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// User assigned identity properties public partial class UserAssignedIdentity : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentity, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentityInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentity, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentityInternal { /// Backing field for property. @@ -21,10 +21,10 @@ public partial class UserAssignedIdentity : public string ClientId { get => this._clientId; } /// Internal Acessors for ClientId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentityInternal.ClientId { get => this._clientId; set { {_clientId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentityInternal.ClientId { get => this._clientId; set { {_clientId = value;} } } /// Internal Acessors for PrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } /// Backing field for property. private string _principalId; @@ -47,6 +47,9 @@ public partial interface IUserAssignedIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The client ID of the assigned identity.", SerializedName = @"clientId", PossibleTypes = new [] { typeof(string) })] @@ -55,6 +58,9 @@ public partial interface IUserAssignedIdentity : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The principal ID of the assigned identity.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentity.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentity.json.cs similarity index 95% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentity.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentity.json.cs index 53cf76f13b34..32b86266433b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/UserAssignedIdentity.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/UserAssignedIdentity.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class UserAssignedIdentity partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentity. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentity. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentity. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentity. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IUserAssignedIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new UserAssignedIdentity(json) : null; } @@ -84,11 +84,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); } @@ -108,8 +108,8 @@ internal UserAssignedIdentity(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis. { return; } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)_clientId;} AfterFromJson(json); } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Workspace.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Workspace.PowerShell.cs new file mode 100644 index 000000000000..aef59c4b53be --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Workspace.PowerShell.cs @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + + /// Workspace resource. + [System.ComponentModel.TypeConverter(typeof(WorkspaceTypeConverter))] + public partial class Workspace + { + + /// + /// 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.HealthcareApis.Models.IWorkspace DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Workspace(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.HealthcareApis.Models.IWorkspace DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Workspace(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.HealthcareApis.Models.IWorkspace FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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 Workspace(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.HealthcareApis.Models.IWorkspaceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.WorkspacePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).PublicNetworkAccess, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Workspace(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.HealthcareApis.Models.IWorkspaceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.WorkspacePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).PublicNetworkAccess, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + } + /// Workspace resource. + [System.ComponentModel.TypeConverter(typeof(WorkspaceTypeConverter))] + public partial interface IWorkspace + + { + + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Workspace.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Workspace.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Workspace.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Workspace.TypeConverter.cs index 6037e4e89602..bf443245c9fe 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Workspace.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Workspace.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IWorkspace ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Workspace.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Workspace.cs similarity index 56% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Workspace.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Workspace.cs index b67ccfc971b4..d22f62e150e1 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Workspace.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Workspace.cs @@ -3,89 +3,107 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Workspace resource. public partial class Workspace : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResource __taggedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.TaggedResource(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResource __taggedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.TaggedResource(); /// /// An etag associated with the resource, used for optimistic concurrency when editing it. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Etag = value ?? null; } /// The resource identifier. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Id; } /// The resource location. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.FormatTable(Index = 0)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)__taggedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ILocationBasedResourceInternal)__taggedResource).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)__taggedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ILocationBasedResourceInternal)__taggedResource).Location = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Type = value ?? null; } /// Internal Acessors for PrivateEndpointConnection - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal.PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)Property).PrivateEndpointConnection = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal.PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)Property).PrivateEndpointConnection = value ?? null /* arrayOf */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.WorkspaceProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceProperties Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.WorkspaceProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)Property).ProvisioningState = value ?? null; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } /// The resource name. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.FormatTable(Index = 1)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Name; } /// The list of private endpoint connections that are set up for this resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)Property).PrivateEndpointConnection; } + public System.Collections.Generic.List PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)Property).PrivateEndpointConnection; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceProperties _property; /// Workspaces resource specific properties. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.WorkspaceProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.WorkspaceProperties()); set => this._property = value; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)Property).ProvisioningState; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)Property).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess)""); } + public string PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)Property).PublicNetworkAccess = value ?? null; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] @@ -93,52 +111,52 @@ public partial class Workspace : 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); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData _systemData; /// Metadata pertaining to creation and last modification of the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)__taggedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)__taggedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)__taggedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)__taggedResource).Tag = value ?? null /* model class */; } /// The resource type. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.DoNotFormat] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceCoreInternal)__taggedResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceCoreInternal)__taggedResource).Type; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -161,112 +179,147 @@ public Workspace() /// Workspace resource. public partial interface IWorkspace : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResource + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResource { /// The list of private endpoint connections that are set up for this resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The list of private endpoint connections that are set up for this resource.", SerializedName = @"privateEndpointConnections", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection) })] + System.Collections.Generic.List PrivateEndpointConnection { get; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } + global::System.DateTime? SystemDataCreatedAt { get; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } + string SystemDataCreatedBy { get; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } + global::System.DateTime? SystemDataLastModifiedAt { get; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } + string SystemDataLastModifiedBy { get; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } } /// Workspace resource. internal partial interface IWorkspaceInternal : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ITaggedResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ITaggedResourceInternal { /// The list of private endpoint connections that are set up for this resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + System.Collections.Generic.List PrivateEndpointConnection { get; set; } /// Workspaces resource specific properties. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceProperties Property { get; set; } /// The provisioning state. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; set; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } /// Metadata pertaining to creation and last modification of the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ISystemData SystemData { get; set; } /// The timestamp of resource creation (UTC). global::System.DateTime? SystemDataCreatedAt { get; set; } /// The identity that created the resource. string SystemDataCreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// The identity that last modified the resource. string SystemDataLastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Workspace.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Workspace.json.cs similarity index 93% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Workspace.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Workspace.json.cs index 0a432cfeb67b..828eadf1610a 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/Workspace.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Workspace.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class Workspace partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new Workspace(json) : null; } @@ -86,7 +86,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T } __taggedResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } @@ -106,9 +106,9 @@ internal Workspace(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Jso { return; } - __taggedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.TaggedResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.WorkspaceProperties.FromJson(__jsonProperties) : Property;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.SystemData.FromJson(__jsonSystemData) : SystemData;} + __taggedResource = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.TaggedResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.WorkspaceProperties.FromJson(__jsonProperties) : _property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} AfterFromJson(json); } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceList.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceList.PowerShell.cs similarity index 70% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceList.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceList.PowerShell.cs index 4f8ad67778ff..79c9653e26a2 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceList.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceList.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class WorkspaceList partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkspaceList(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.HealthcareApis.Models.Api20211101.IWorkspaceList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkspaceList(content); } @@ -85,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,17 +128,17 @@ internal WorkspaceList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.WorkspaceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.WorkspaceTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,11 +153,11 @@ internal WorkspaceList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.WorkspaceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.WorkspaceTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceList.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceList.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceList.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceList.TypeConverter.cs index eb61d4592855..ab38c24f33ab 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceList.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceList.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IWorkspaceList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceList.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceList.cs similarity index 77% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceList.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceList.cs index fccf21ca2d2f..3bef9864f244 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceList.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceList.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Collection of workspace object with a next link public partial class WorkspaceList : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceList, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceListInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceList, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceListInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class WorkspaceList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace[] _value; + private System.Collections.Generic.List _value; /// Collection of resources. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public WorkspaceList() @@ -41,6 +41,9 @@ public partial interface IWorkspaceList : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link used to get the next page.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IWorkspaceList : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Collection of resources.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace) })] + System.Collections.Generic.List Value { get; set; } } /// Collection of workspace object with a next link @@ -62,7 +68,7 @@ internal partial interface IWorkspaceListInternal /// The link used to get the next page. string NextLink { get; set; } /// Collection of resources. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceList.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceList.json.cs similarity index 91% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceList.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceList.json.cs index 0f78db44e15e..3c89e0b14ae0 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceList.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceList.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkspaceList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new WorkspaceList(json) : null; } @@ -110,8 +110,8 @@ internal WorkspaceList(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime { return; } - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IWorkspace) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.Workspace.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.HealthcareApis.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.HealthcareApis.Models.IWorkspace) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Workspace.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspacePatchResource.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspacePatchResource.PowerShell.cs similarity index 75% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspacePatchResource.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspacePatchResource.PowerShell.cs index 785c50f42d73..dfd122cfcc32 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspacePatchResource.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspacePatchResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class WorkspacePatchResource partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePatchResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePatchResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkspacePatchResource(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.HealthcareApis.Models.Api20211101.IWorkspacePatchResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePatchResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkspacePatchResource(content); } @@ -87,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePatchResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePatchResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -110,13 +128,13 @@ internal WorkspacePatchResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.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. @@ -131,7 +149,7 @@ internal WorkspacePatchResource(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspacePatchResource.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspacePatchResource.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspacePatchResource.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspacePatchResource.TypeConverter.cs index b4b22c73879d..98d164362ae0 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspacePatchResource.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspacePatchResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IWorkspacePatchResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePatchResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePatchResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePatchResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspacePatchResource.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspacePatchResource.cs similarity index 78% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspacePatchResource.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspacePatchResource.cs index 1d499a756b46..e0cde1205d91 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspacePatchResource.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspacePatchResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Workspace patch properties public partial class WorkspacePatchResource : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePatchResource, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePatchResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePatchResource, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePatchResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1 __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTags1(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1 __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTags1(); /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)__resourceTags1).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal)__resourceTags1).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)__resourceTags1).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal)__resourceTags1).Tag = value ?? null /* model class */; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -44,13 +44,13 @@ public WorkspacePatchResource() /// Workspace patch properties public partial interface IWorkspacePatchResource : Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1 + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1 { } /// Workspace patch properties internal partial interface IWorkspacePatchResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1Internal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags1Internal { } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspacePatchResource.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspacePatchResource.json.cs similarity index 94% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspacePatchResource.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspacePatchResource.json.cs index c84d8966bb1a..ada739e79d60 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspacePatchResource.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspacePatchResource.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkspacePatchResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePatchResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePatchResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePatchResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePatchResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePatchResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePatchResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new WorkspacePatchResource(json) : null; } @@ -101,7 +101,7 @@ internal WorkspacePatchResource(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApi { return; } - __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTags1(json); + __resourceTags1 = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ResourceTags1(json); AfterFromJson(json); } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceProperties.PowerShell.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceProperties.PowerShell.cs similarity index 66% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceProperties.PowerShell.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceProperties.PowerShell.cs index 86ff36a0cce6..6beeb49d10cc 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceProperties.PowerShell.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class WorkspaceProperties partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkspaceProperties(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.HealthcareApis.Models.Api20211101.IWorkspaceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkspaceProperties(content); } @@ -85,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api202111 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.SerializationMode.IncludeAll)?.ToString(); + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,21 +128,21 @@ internal WorkspaceProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("PrivateEndpointConnection")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); } if (content.Contains("PublicNetworkAccess")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)this).PublicNetworkAccess, 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,15 +157,15 @@ internal WorkspaceProperties(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("PrivateEndpointConnection")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); } if (content.Contains("PublicNetworkAccess")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal)this).PublicNetworkAccess, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceProperties.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceProperties.TypeConverter.cs similarity index 97% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceProperties.TypeConverter.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceProperties.TypeConverter.cs index 9055f23b1c13..48e8d454d29e 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceProperties.TypeConverter.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IWorkspaceProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceProperties.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceProperties.cs similarity index 57% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceProperties.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceProperties.cs index 14799949360b..9da48ffeae45 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceProperties.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceProperties.cs @@ -3,44 +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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; /// Workspaces resource specific properties. public partial class WorkspaceProperties : - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceProperties, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceProperties, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal { /// Internal Acessors for PrivateEndpointConnection - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal.PrivateEndpointConnection { get => this._privateEndpointConnection; set { {_privateEndpointConnection = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal.PrivateEndpointConnection { get => this._privateEndpointConnection; set { {_privateEndpointConnection = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspacePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] _privateEndpointConnection; + private System.Collections.Generic.List _privateEndpointConnection; /// The list of private endpoint connections that are set up for this resource. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get => this._privateEndpointConnection; } + public System.Collections.Generic.List PrivateEndpointConnection { get => this._privateEndpointConnection; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? _publicNetworkAccess; + private string _publicNetworkAccess; /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } + public string PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } /// Creates an new instance. public WorkspaceProperties() @@ -56,28 +56,39 @@ public partial interface IWorkspaceProperties : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The list of private endpoint connections that are set up for this resource.", SerializedName = @"privateEndpointConnections", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection) })] + System.Collections.Generic.List PrivateEndpointConnection { get; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } } /// Workspaces resource specific properties. @@ -85,13 +96,15 @@ internal partial interface IWorkspacePropertiesInternal { /// The list of private endpoint connections that are set up for this resource. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + System.Collections.Generic.List PrivateEndpointConnection { get; set; } /// The provisioning state. - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Deleting", "Succeeded", "Creating", "Accepted", "Verifying", "Updating", "Failed", "Canceled", "Deprovisioned", "Moving", "Suspended", "Warned", "SystemMaintenance")] + string ProvisioningState { get; set; } /// /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceProperties.json.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceProperties.json.cs similarity index 90% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceProperties.json.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceProperties.json.cs index f504f57303f6..3d5d25b73fe0 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/Api20211101/WorkspaceProperties.json.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Models/WorkspaceProperties.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.HealthcareApis.Models.Api20211101 +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkspaceProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject json ? new WorkspaceProperties(json) : null; } @@ -84,11 +84,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode T { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeRead)) { if (null != this._privateEndpointConnection) { @@ -117,9 +117,9 @@ internal WorkspaceProperties(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.R { return; } - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_privateEndpointConnection = If( json?.PropertyT("privateEndpointConnections"), out var __jsonPrivateEndpointConnections) ? If( __jsonPrivateEndpointConnections as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api10.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnection.FromJson(__u) )) ))() : null : PrivateEndpointConnection;} - {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)PublicNetworkAccess;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_privateEndpointConnection = If( json?.PropertyT("privateEndpointConnections"), out var __jsonPrivateEndpointConnections) ? If( __jsonPrivateEndpointConnections as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnection.FromJson(__u) )) ))() : null : _privateEndpointConnection;} + {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)_publicNetworkAccess;} AfterFromJson(json); } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ActionType.Completer.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ActionType.Completer.cs deleted file mode 100644 index 9fc90ae2cbaa..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ActionType.Completer.cs +++ /dev/null @@ -1,37 +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.HealthcareApis.Support -{ - - /// - /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ActionTypeTypeConverter))] - public partial struct ActionType : - 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) || "Internal".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Internal'", "Internal", global::System.Management.Automation.CompletionResultType.ParameterValue, "Internal"); - } - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ActionType.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ActionType.TypeConverter.cs deleted file mode 100644 index 8f99e1d3d951..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ActionType.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.HealthcareApis.Support -{ - - /// - /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - /// - public partial class ActionTypeTypeConverter : - 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) => ActionType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ActionType.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ActionType.cs deleted file mode 100644 index 230b583de03f..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ActionType.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.HealthcareApis.Support -{ - - /// - /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - /// - public partial struct ActionType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ActionType Internal = @"Internal"; - - /// 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 ActionType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ActionType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ActionType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ActionType - /// 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.HealthcareApis.Support.ActionType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ActionType (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 ActionType && Equals((ActionType)obj); - } - - /// Returns hashCode for enum ActionType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ActionType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ActionType - /// the value to convert to an instance of . - - public static implicit operator ActionType(string value) - { - return new ActionType(value); - } - - /// Implicit operator to convert ActionType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ActionType e) - { - return e._value; - } - - /// Overriding != operator for enum ActionType - /// 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.HealthcareApis.Support.ActionType e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ActionType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ActionType - /// 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.HealthcareApis.Support.ActionType e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ActionType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/CreatedByType.Completer.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/CreatedByType.Completer.cs deleted file mode 100644 index ada969536e38..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/CreatedByType.Completer.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support -{ - - /// The type of identity that created the resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByTypeTypeConverter))] - public partial struct CreatedByType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "User".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'User'", "User", global::System.Management.Automation.CompletionResultType.ParameterValue, "User"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Application".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Application'", "Application", global::System.Management.Automation.CompletionResultType.ParameterValue, "Application"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ManagedIdentity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ManagedIdentity'", "ManagedIdentity", global::System.Management.Automation.CompletionResultType.ParameterValue, "ManagedIdentity"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Key".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Key'", "Key", global::System.Management.Automation.CompletionResultType.ParameterValue, "Key"); - } - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs deleted file mode 100644 index f0eb72f034b1..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support -{ - - /// The type of identity that created the resource. - public partial class CreatedByTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => CreatedByType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/CreatedByType.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/CreatedByType.cs deleted file mode 100644 index a335edeb2fa4..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/CreatedByType.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support -{ - - /// The type of identity that created the resource. - public partial struct CreatedByType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType Application = @"Application"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType Key = @"Key"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType User = @"User"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to CreatedByType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new CreatedByType(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private CreatedByType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type CreatedByType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type CreatedByType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is CreatedByType && Equals((CreatedByType)obj); - } - - /// Returns hashCode for enum CreatedByType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for CreatedByType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to CreatedByType - /// the value to convert to an instance of . - - public static implicit operator CreatedByType(string value) - { - return new CreatedByType(value); - } - - /// Implicit operator to convert CreatedByType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType e) - { - return e._value; - } - - /// Overriding != operator for enum CreatedByType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum CreatedByType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.CreatedByType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirResourceVersionPolicy.Completer.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirResourceVersionPolicy.Completer.cs deleted file mode 100644 index 0002bf638522..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirResourceVersionPolicy.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.HealthcareApis.Support -{ - - /// Controls how resources are versioned on the FHIR service - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicyTypeConverter))] - public partial struct FhirResourceVersionPolicy : - 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) || "no-version".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'no-version'", "no-version", global::System.Management.Automation.CompletionResultType.ParameterValue, "no-version"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "versioned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'versioned'", "versioned", global::System.Management.Automation.CompletionResultType.ParameterValue, "versioned"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "versioned-update".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'versioned-update'", "versioned-update", global::System.Management.Automation.CompletionResultType.ParameterValue, "versioned-update"); - } - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirResourceVersionPolicy.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirResourceVersionPolicy.TypeConverter.cs deleted file mode 100644 index 1aafe248a629..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirResourceVersionPolicy.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.HealthcareApis.Support -{ - - /// Controls how resources are versioned on the FHIR service - public partial class FhirResourceVersionPolicyTypeConverter : - 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) => FhirResourceVersionPolicy.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirResourceVersionPolicy.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirResourceVersionPolicy.cs deleted file mode 100644 index f4938d2a4dcd..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirResourceVersionPolicy.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.HealthcareApis.Support -{ - - /// Controls how resources are versioned on the FHIR service - public partial struct FhirResourceVersionPolicy : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy NoVersion = @"no-version"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy Versioned = @"versioned"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy VersionedUpdate = @"versioned-update"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to FhirResourceVersionPolicy - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new FhirResourceVersionPolicy(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type FhirResourceVersionPolicy - /// 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.HealthcareApis.Support.FhirResourceVersionPolicy e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type FhirResourceVersionPolicy (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 FhirResourceVersionPolicy && Equals((FhirResourceVersionPolicy)obj); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private FhirResourceVersionPolicy(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns hashCode for enum FhirResourceVersionPolicy - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for FhirResourceVersionPolicy - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to FhirResourceVersionPolicy - /// the value to convert to an instance of . - - public static implicit operator FhirResourceVersionPolicy(string value) - { - return new FhirResourceVersionPolicy(value); - } - - /// Implicit operator to convert FhirResourceVersionPolicy to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy e) - { - return e._value; - } - - /// Overriding != operator for enum FhirResourceVersionPolicy - /// 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.HealthcareApis.Support.FhirResourceVersionPolicy e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum FhirResourceVersionPolicy - /// 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.HealthcareApis.Support.FhirResourceVersionPolicy e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirServiceKind.Completer.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirServiceKind.Completer.cs deleted file mode 100644 index 792fdd364b3a..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirServiceKind.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.HealthcareApis.Support -{ - - /// The kind of the service. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKindTypeConverter))] - public partial struct FhirServiceKind : - 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) || "fhir-Stu3".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'fhir-Stu3'", "fhir-Stu3", global::System.Management.Automation.CompletionResultType.ParameterValue, "fhir-Stu3"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "fhir-R4".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'fhir-R4'", "fhir-R4", global::System.Management.Automation.CompletionResultType.ParameterValue, "fhir-R4"); - } - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirServiceKind.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirServiceKind.TypeConverter.cs deleted file mode 100644 index 68edbdcf8ac3..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirServiceKind.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.HealthcareApis.Support -{ - - /// The kind of the service. - public partial class FhirServiceKindTypeConverter : - 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) => FhirServiceKind.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirServiceKind.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirServiceKind.cs deleted file mode 100644 index 92ec7be3306d..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/FhirServiceKind.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.HealthcareApis.Support -{ - - /// The kind of the service. - public partial struct FhirServiceKind : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind FhirR4 = @"fhir-R4"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind FhirStu3 = @"fhir-Stu3"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to FhirServiceKind - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new FhirServiceKind(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type FhirServiceKind - /// 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.HealthcareApis.Support.FhirServiceKind e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type FhirServiceKind (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 FhirServiceKind && Equals((FhirServiceKind)obj); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private FhirServiceKind(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns hashCode for enum FhirServiceKind - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for FhirServiceKind - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to FhirServiceKind - /// the value to convert to an instance of . - - public static implicit operator FhirServiceKind(string value) - { - return new FhirServiceKind(value); - } - - /// Implicit operator to convert FhirServiceKind to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind e) - { - return e._value; - } - - /// Overriding != operator for enum FhirServiceKind - /// 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.HealthcareApis.Support.FhirServiceKind e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum FhirServiceKind - /// 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.HealthcareApis.Support.FhirServiceKind e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/IotIdentityResolutionType.Completer.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/IotIdentityResolutionType.Completer.cs deleted file mode 100644 index d77c528dcebf..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/IotIdentityResolutionType.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.HealthcareApis.Support -{ - - /// The type of IoT identity resolution to use with the destination. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionTypeTypeConverter))] - public partial struct IotIdentityResolutionType : - 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) || "Create".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Create'", "Create", global::System.Management.Automation.CompletionResultType.ParameterValue, "Create"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Lookup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Lookup'", "Lookup", global::System.Management.Automation.CompletionResultType.ParameterValue, "Lookup"); - } - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/IotIdentityResolutionType.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/IotIdentityResolutionType.TypeConverter.cs deleted file mode 100644 index 2d14c1b22d17..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/IotIdentityResolutionType.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.HealthcareApis.Support -{ - - /// The type of IoT identity resolution to use with the destination. - public partial class IotIdentityResolutionTypeTypeConverter : - 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) => IotIdentityResolutionType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/IotIdentityResolutionType.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/IotIdentityResolutionType.cs deleted file mode 100644 index 9c89103dec6a..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/IotIdentityResolutionType.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.HealthcareApis.Support -{ - - /// The type of IoT identity resolution to use with the destination. - public partial struct IotIdentityResolutionType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType Create = @"Create"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType Lookup = @"Lookup"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to IotIdentityResolutionType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new IotIdentityResolutionType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type IotIdentityResolutionType - /// 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.HealthcareApis.Support.IotIdentityResolutionType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type IotIdentityResolutionType (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 IotIdentityResolutionType && Equals((IotIdentityResolutionType)obj); - } - - /// Returns hashCode for enum IotIdentityResolutionType - /// 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 IotIdentityResolutionType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for IotIdentityResolutionType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to IotIdentityResolutionType - /// the value to convert to an instance of . - - public static implicit operator IotIdentityResolutionType(string value) - { - return new IotIdentityResolutionType(value); - } - - /// Implicit operator to convert IotIdentityResolutionType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType e) - { - return e._value; - } - - /// Overriding != operator for enum IotIdentityResolutionType - /// 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.HealthcareApis.Support.IotIdentityResolutionType e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum IotIdentityResolutionType - /// 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.HealthcareApis.Support.IotIdentityResolutionType e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/Kind.Completer.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/Kind.Completer.cs deleted file mode 100644 index f6b666c8a3a4..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/Kind.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.HealthcareApis.Support -{ - - /// The kind of the service. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.KindTypeConverter))] - public partial struct Kind : - 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) || "fhir".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'fhir'", "fhir", global::System.Management.Automation.CompletionResultType.ParameterValue, "fhir"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "fhir-Stu3".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'fhir-Stu3'", "fhir-Stu3", global::System.Management.Automation.CompletionResultType.ParameterValue, "fhir-Stu3"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "fhir-R4".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'fhir-R4'", "fhir-R4", global::System.Management.Automation.CompletionResultType.ParameterValue, "fhir-R4"); - } - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/Kind.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/Kind.TypeConverter.cs deleted file mode 100644 index 6ecaae22d45b..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/Kind.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.HealthcareApis.Support -{ - - /// The kind of the service. - public partial class KindTypeConverter : - 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) => Kind.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/Kind.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/Kind.cs deleted file mode 100644 index 00a22f8ceddf..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/Kind.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.HealthcareApis.Support -{ - - /// The kind of the service. - public partial struct Kind : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind Fhir = @"fhir"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind FhirR4 = @"fhir-R4"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind FhirStu3 = @"fhir-Stu3"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to Kind - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new Kind(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type Kind - /// 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.HealthcareApis.Support.Kind e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type Kind (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 Kind && Equals((Kind)obj); - } - - /// Returns hashCode for enum Kind - /// 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 Kind(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for Kind - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to Kind - /// the value to convert to an instance of . - - public static implicit operator Kind(string value) - { - return new Kind(value); - } - - /// Implicit operator to convert Kind to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind e) - { - return e._value; - } - - /// Overriding != operator for enum Kind - /// 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.HealthcareApis.Support.Kind e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum Kind - /// 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.HealthcareApis.Support.Kind e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ManagedServiceIdentityType.Completer.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ManagedServiceIdentityType.Completer.cs deleted file mode 100644 index cdc802bacf57..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ManagedServiceIdentityType.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.HealthcareApis.Support -{ - - /// - /// Type of identity being specified, currently SystemAssigned and None are allowed. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityTypeTypeConverter))] - public partial struct ManagedServiceIdentityType : - 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/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ManagedServiceIdentityType.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ManagedServiceIdentityType.TypeConverter.cs deleted file mode 100644 index 5bc7975b1fa2..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ManagedServiceIdentityType.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.HealthcareApis.Support -{ - - /// - /// Type of identity being specified, currently SystemAssigned and None are allowed. - /// - public partial class ManagedServiceIdentityTypeTypeConverter : - 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) => ManagedServiceIdentityType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ManagedServiceIdentityType.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ManagedServiceIdentityType.cs deleted file mode 100644 index 3b1636600ef1..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ManagedServiceIdentityType.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.HealthcareApis.Support -{ - - /// - /// Type of identity being specified, currently SystemAssigned and None are allowed. - /// - public partial struct ManagedServiceIdentityType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType None = @"None"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType SystemAssigned = @"SystemAssigned"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to ManagedServiceIdentityType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ManagedServiceIdentityType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ManagedServiceIdentityType - /// 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.HealthcareApis.Support.ManagedServiceIdentityType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ManagedServiceIdentityType (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 ManagedServiceIdentityType && Equals((ManagedServiceIdentityType)obj); - } - - /// Returns hashCode for enum ManagedServiceIdentityType - /// 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 ManagedServiceIdentityType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ManagedServiceIdentityType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ManagedServiceIdentityType - /// the value to convert to an instance of . - - public static implicit operator ManagedServiceIdentityType(string value) - { - return new ManagedServiceIdentityType(value); - } - - /// Implicit operator to convert ManagedServiceIdentityType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType e) - { - return e._value; - } - - /// Overriding != operator for enum ManagedServiceIdentityType - /// 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.HealthcareApis.Support.ManagedServiceIdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ManagedServiceIdentityType - /// 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.HealthcareApis.Support.ManagedServiceIdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/OperationResultStatus.Completer.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/OperationResultStatus.Completer.cs deleted file mode 100644 index fe8cac769865..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/OperationResultStatus.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.HealthcareApis.Support -{ - - /// The status of the operation being performed. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatusTypeConverter))] - public partial struct OperationResultStatus : - 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) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); - } - 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) || "Requested".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Requested'", "Requested", global::System.Management.Automation.CompletionResultType.ParameterValue, "Requested"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/OperationResultStatus.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/OperationResultStatus.TypeConverter.cs deleted file mode 100644 index 04de494c91df..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/OperationResultStatus.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.HealthcareApis.Support -{ - - /// The status of the operation being performed. - public partial class OperationResultStatusTypeConverter : - 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) => OperationResultStatus.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/OperationResultStatus.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/OperationResultStatus.cs deleted file mode 100644 index d8a95b9f2650..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/OperationResultStatus.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.HealthcareApis.Support -{ - - /// The status of the operation being performed. - public partial struct OperationResultStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatus Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatus Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatus Requested = @"Requested"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatus Running = @"Running"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatus Succeeded = @"Succeeded"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to OperationResultStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new OperationResultStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type OperationResultStatus - /// 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.HealthcareApis.Support.OperationResultStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type OperationResultStatus (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 OperationResultStatus && Equals((OperationResultStatus)obj); - } - - /// Returns hashCode for enum OperationResultStatus - /// 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 OperationResultStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for OperationResultStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to OperationResultStatus - /// the value to convert to an instance of . - - public static implicit operator OperationResultStatus(string value) - { - return new OperationResultStatus(value); - } - - /// Implicit operator to convert OperationResultStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatus e) - { - return e._value; - } - - /// Overriding != operator for enum OperationResultStatus - /// 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.HealthcareApis.Support.OperationResultStatus e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum OperationResultStatus - /// 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.HealthcareApis.Support.OperationResultStatus e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.OperationResultStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.Completer.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.Completer.cs deleted file mode 100644 index 8d93565b5687..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.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.HealthcareApis.Support -{ - - /// The current provisioning state. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningStateTypeConverter))] - public partial struct PrivateEndpointConnectionProvisioningState : - 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) || "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) || "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"); - } - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.TypeConverter.cs deleted file mode 100644 index bcda5cc7df89..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.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.HealthcareApis.Support -{ - - /// The current provisioning state. - public partial class PrivateEndpointConnectionProvisioningStateTypeConverter : - 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) => PrivateEndpointConnectionProvisioningState.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs deleted file mode 100644 index f9e9ed21a457..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs +++ /dev/null @@ -1,112 +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.HealthcareApis.Support -{ - - /// The current provisioning state. - public partial struct PrivateEndpointConnectionProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState Creating = @"Creating"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState Succeeded = @"Succeeded"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to PrivateEndpointConnectionProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PrivateEndpointConnectionProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PrivateEndpointConnectionProvisioningState - /// 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.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type PrivateEndpointConnectionProvisioningState (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 PrivateEndpointConnectionProvisioningState && Equals((PrivateEndpointConnectionProvisioningState)obj); - } - - /// Returns hashCode for enum PrivateEndpointConnectionProvisioningState - /// 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 PrivateEndpointConnectionProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PrivateEndpointConnectionProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Implicit operator to convert string to PrivateEndpointConnectionProvisioningState - /// - /// the value to convert to an instance of . - - public static implicit operator PrivateEndpointConnectionProvisioningState(string value) - { - return new PrivateEndpointConnectionProvisioningState(value); - } - - /// - /// Implicit operator to convert PrivateEndpointConnectionProvisioningState to string - /// - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum PrivateEndpointConnectionProvisioningState - /// 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.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PrivateEndpointConnectionProvisioningState - /// 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.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointConnectionProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.Completer.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.Completer.cs deleted file mode 100644 index f70f25425139..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.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.HealthcareApis.Support -{ - - /// The private endpoint connection status. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatusTypeConverter))] - public partial struct PrivateEndpointServiceConnectionStatus : - 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) || "Approved".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Approved'", "Approved", global::System.Management.Automation.CompletionResultType.ParameterValue, "Approved"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Rejected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Rejected'", "Rejected", global::System.Management.Automation.CompletionResultType.ParameterValue, "Rejected"); - } - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.TypeConverter.cs deleted file mode 100644 index 3f878a13c0b0..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.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.HealthcareApis.Support -{ - - /// The private endpoint connection status. - public partial class PrivateEndpointServiceConnectionStatusTypeConverter : - 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) => PrivateEndpointServiceConnectionStatus.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs deleted file mode 100644 index 921e1b0a1df4..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.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.HealthcareApis.Support -{ - - /// The private endpoint connection status. - public partial struct PrivateEndpointServiceConnectionStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus Approved = @"Approved"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus Pending = @"Pending"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus Rejected = @"Rejected"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to PrivateEndpointServiceConnectionStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PrivateEndpointServiceConnectionStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PrivateEndpointServiceConnectionStatus - /// 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.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type PrivateEndpointServiceConnectionStatus (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 PrivateEndpointServiceConnectionStatus && Equals((PrivateEndpointServiceConnectionStatus)obj); - } - - /// Returns hashCode for enum PrivateEndpointServiceConnectionStatus - /// 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 PrivateEndpointServiceConnectionStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PrivateEndpointServiceConnectionStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to PrivateEndpointServiceConnectionStatus - /// the value to convert to an instance of . - - public static implicit operator PrivateEndpointServiceConnectionStatus(string value) - { - return new PrivateEndpointServiceConnectionStatus(value); - } - - /// Implicit operator to convert PrivateEndpointServiceConnectionStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus e) - { - return e._value; - } - - /// Overriding != operator for enum PrivateEndpointServiceConnectionStatus - /// 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.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PrivateEndpointServiceConnectionStatus - /// 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.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ProvisioningState.Completer.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ProvisioningState.Completer.cs deleted file mode 100644 index e2e70d0784ee..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ProvisioningState.Completer.cs +++ /dev/null @@ -1,83 +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.HealthcareApis.Support -{ - - /// The provisioning state. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningStateTypeConverter))] - public partial struct ProvisioningState : - 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) || "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) || "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) || "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) || "Accepted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Accepted'", "Accepted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Accepted"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Verifying".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Verifying'", "Verifying", global::System.Management.Automation.CompletionResultType.ParameterValue, "Verifying"); - } - 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) || "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) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deprovisioned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deprovisioned'", "Deprovisioned", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deprovisioned"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Moving".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Moving'", "Moving", global::System.Management.Automation.CompletionResultType.ParameterValue, "Moving"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Suspended".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Suspended'", "Suspended", global::System.Management.Automation.CompletionResultType.ParameterValue, "Suspended"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Warned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Warned'", "Warned", global::System.Management.Automation.CompletionResultType.ParameterValue, "Warned"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SystemMaintenance".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SystemMaintenance'", "SystemMaintenance", global::System.Management.Automation.CompletionResultType.ParameterValue, "SystemMaintenance"); - } - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ProvisioningState.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ProvisioningState.TypeConverter.cs deleted file mode 100644 index 898c4d5ebb54..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ProvisioningState.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.HealthcareApis.Support -{ - - /// The provisioning state. - public partial class ProvisioningStateTypeConverter : - 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) => ProvisioningState.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ProvisioningState.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ProvisioningState.cs deleted file mode 100644 index ad41baaa3951..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ProvisioningState.cs +++ /dev/null @@ -1,120 +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.HealthcareApis.Support -{ - - /// The provisioning state. - public partial struct ProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState Creating = @"Creating"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState Deprovisioned = @"Deprovisioned"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState Moving = @"Moving"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState Suspended = @"Suspended"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState SystemMaintenance = @"SystemMaintenance"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState Updating = @"Updating"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState Verifying = @"Verifying"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState Warned = @"Warned"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ProvisioningState - /// 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.HealthcareApis.Support.ProvisioningState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ProvisioningState (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 ProvisioningState && Equals((ProvisioningState)obj); - } - - /// Returns hashCode for enum ProvisioningState - /// 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 ProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ProvisioningState - /// the value to convert to an instance of . - - public static implicit operator ProvisioningState(string value) - { - return new ProvisioningState(value); - } - - /// Implicit operator to convert ProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum ProvisioningState - /// 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.HealthcareApis.Support.ProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ProvisioningState - /// 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.HealthcareApis.Support.ProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PublicNetworkAccess.Completer.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PublicNetworkAccess.Completer.cs deleted file mode 100644 index a332eda3ccc2..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PublicNetworkAccess.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.HealthcareApis.Support -{ - - /// - /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccessTypeConverter))] - public partial struct PublicNetworkAccess : - 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/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PublicNetworkAccess.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PublicNetworkAccess.TypeConverter.cs deleted file mode 100644 index 1281beba4851..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PublicNetworkAccess.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.HealthcareApis.Support -{ - - /// - /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. - /// - public partial class PublicNetworkAccessTypeConverter : - 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) => PublicNetworkAccess.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PublicNetworkAccess.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PublicNetworkAccess.cs deleted file mode 100644 index dc910935a6e6..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/PublicNetworkAccess.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.HealthcareApis.Support -{ - - /// - /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. - /// - public partial struct PublicNetworkAccess : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess Disabled = @"Disabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess Enabled = @"Enabled"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to PublicNetworkAccess - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PublicNetworkAccess(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PublicNetworkAccess - /// 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.HealthcareApis.Support.PublicNetworkAccess e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type PublicNetworkAccess (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 PublicNetworkAccess && Equals((PublicNetworkAccess)obj); - } - - /// Returns hashCode for enum PublicNetworkAccess - /// 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 PublicNetworkAccess(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PublicNetworkAccess - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to PublicNetworkAccess - /// the value to convert to an instance of . - - public static implicit operator PublicNetworkAccess(string value) - { - return new PublicNetworkAccess(value); - } - - /// Implicit operator to convert PublicNetworkAccess to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess e) - { - return e._value; - } - - /// Overriding != operator for enum PublicNetworkAccess - /// 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.HealthcareApis.Support.PublicNetworkAccess e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PublicNetworkAccess - /// 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.HealthcareApis.Support.PublicNetworkAccess e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceEventState.Completer.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceEventState.Completer.cs deleted file mode 100644 index 5186172e0f44..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceEventState.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.HealthcareApis.Support -{ - - /// Indicates the current status of event support for the resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventStateTypeConverter))] - public partial struct ServiceEventState : - 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) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); - } - 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) || "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/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceEventState.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceEventState.TypeConverter.cs deleted file mode 100644 index 11ed8a979812..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceEventState.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.HealthcareApis.Support -{ - - /// Indicates the current status of event support for the resource. - public partial class ServiceEventStateTypeConverter : - 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) => ServiceEventState.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceEventState.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceEventState.cs deleted file mode 100644 index 91706bd9cf0f..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceEventState.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.HealthcareApis.Support -{ - - /// Indicates the current status of event support for the resource. - public partial struct ServiceEventState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState Disabled = @"Disabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState Enabled = @"Enabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState Updating = @"Updating"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ServiceEventState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ServiceEventState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ServiceEventState - /// 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.HealthcareApis.Support.ServiceEventState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ServiceEventState (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 ServiceEventState && Equals((ServiceEventState)obj); - } - - /// Returns hashCode for enum ServiceEventState - /// 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 ServiceEventState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ServiceEventState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ServiceEventState - /// the value to convert to an instance of . - - public static implicit operator ServiceEventState(string value) - { - return new ServiceEventState(value); - } - - /// Implicit operator to convert ServiceEventState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState e) - { - return e._value; - } - - /// Overriding != operator for enum ServiceEventState - /// 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.HealthcareApis.Support.ServiceEventState e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ServiceEventState - /// 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.HealthcareApis.Support.ServiceEventState e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceEventState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceManagedIdentityType.Completer.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceManagedIdentityType.Completer.cs deleted file mode 100644 index effc2c07658a..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceManagedIdentityType.Completer.cs +++ /dev/null @@ -1,49 +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.HealthcareApis.Support -{ - - /// - /// Type of identity being specified, currently SystemAssigned and None are allowed. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityTypeTypeConverter))] - public partial struct ServiceManagedIdentityType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SystemAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SystemAssigned'", "SystemAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "SystemAssigned"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "UserAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'UserAssigned'", "UserAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "UserAssigned"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SystemAssigned,UserAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SystemAssigned,UserAssigned'", "SystemAssigned,UserAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "SystemAssigned,UserAssigned"); - } - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceManagedIdentityType.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceManagedIdentityType.TypeConverter.cs deleted file mode 100644 index ce47daf92701..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceManagedIdentityType.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.HealthcareApis.Support -{ - - /// - /// Type of identity being specified, currently SystemAssigned and None are allowed. - /// - public partial class ServiceManagedIdentityTypeTypeConverter : - 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) => ServiceManagedIdentityType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceManagedIdentityType.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceManagedIdentityType.cs deleted file mode 100644 index a738ab35a2ca..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceManagedIdentityType.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.HealthcareApis.Support -{ - - /// - /// Type of identity being specified, currently SystemAssigned and None are allowed. - /// - public partial struct ServiceManagedIdentityType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType None = @"None"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType SystemAssigned = @"SystemAssigned"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType SystemAssignedUserAssigned = @"SystemAssigned,UserAssigned"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType UserAssigned = @"UserAssigned"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to ServiceManagedIdentityType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ServiceManagedIdentityType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ServiceManagedIdentityType - /// 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.HealthcareApis.Support.ServiceManagedIdentityType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ServiceManagedIdentityType (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 ServiceManagedIdentityType && Equals((ServiceManagedIdentityType)obj); - } - - /// Returns hashCode for enum ServiceManagedIdentityType - /// 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 ServiceManagedIdentityType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ServiceManagedIdentityType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ServiceManagedIdentityType - /// the value to convert to an instance of . - - public static implicit operator ServiceManagedIdentityType(string value) - { - return new ServiceManagedIdentityType(value); - } - - /// Implicit operator to convert ServiceManagedIdentityType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType e) - { - return e._value; - } - - /// Overriding != operator for enum ServiceManagedIdentityType - /// 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.HealthcareApis.Support.ServiceManagedIdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ServiceManagedIdentityType - /// 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.HealthcareApis.Support.ServiceManagedIdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceNameUnavailabilityReason.Completer.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceNameUnavailabilityReason.Completer.cs deleted file mode 100644 index 26c5209a9d8f..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceNameUnavailabilityReason.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.HealthcareApis.Support -{ - - /// The reason for unavailability. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceNameUnavailabilityReasonTypeConverter))] - public partial struct ServiceNameUnavailabilityReason : - 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) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AlreadyExists".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AlreadyExists'", "AlreadyExists", global::System.Management.Automation.CompletionResultType.ParameterValue, "AlreadyExists"); - } - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceNameUnavailabilityReason.TypeConverter.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceNameUnavailabilityReason.TypeConverter.cs deleted file mode 100644 index f9617d717912..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceNameUnavailabilityReason.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.HealthcareApis.Support -{ - - /// The reason for unavailability. - public partial class ServiceNameUnavailabilityReasonTypeConverter : - 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) => ServiceNameUnavailabilityReason.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceNameUnavailabilityReason.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceNameUnavailabilityReason.cs deleted file mode 100644 index 97ea90d5cbc3..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/api/Support/ServiceNameUnavailabilityReason.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.HealthcareApis.Support -{ - - /// The reason for unavailability. - public partial struct ServiceNameUnavailabilityReason : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceNameUnavailabilityReason AlreadyExists = @"AlreadyExists"; - - public static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceNameUnavailabilityReason Invalid = @"Invalid"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to ServiceNameUnavailabilityReason - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ServiceNameUnavailabilityReason(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ServiceNameUnavailabilityReason - /// 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.HealthcareApis.Support.ServiceNameUnavailabilityReason e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type ServiceNameUnavailabilityReason (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 ServiceNameUnavailabilityReason && Equals((ServiceNameUnavailabilityReason)obj); - } - - /// Returns hashCode for enum ServiceNameUnavailabilityReason - /// 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 ServiceNameUnavailabilityReason(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ServiceNameUnavailabilityReason - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ServiceNameUnavailabilityReason - /// the value to convert to an instance of . - - public static implicit operator ServiceNameUnavailabilityReason(string value) - { - return new ServiceNameUnavailabilityReason(value); - } - - /// Implicit operator to convert ServiceNameUnavailabilityReason to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceNameUnavailabilityReason e) - { - return e._value; - } - - /// Overriding != operator for enum ServiceNameUnavailabilityReason - /// 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.HealthcareApis.Support.ServiceNameUnavailabilityReason e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceNameUnavailabilityReason e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ServiceNameUnavailabilityReason - /// 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.HealthcareApis.Support.ServiceNameUnavailabilityReason e1, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceNameUnavailabilityReason e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisService_Get.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisService_Get.cs index 74b73fcc86b7..cf843c9f5ca2 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisService_Get.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisService_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Get the metadata of a service instance. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareApisService_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader"}, ChangeDescription="The types of the properties 'PrivateEndpointConnection', 'AccessPolicy', 'AcrConfigurationOciArtifact', 'CorConfigurationOrigin', 'CorConfigurationMethod', 'AcrConfigurationLoginServer', and 'CorConfigurationHeader' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Get the metadata of a service instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareApisService_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzHealthcareApisService_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzHealthcareApisService_Get : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -93,7 +113,7 @@ public partial class GetAzHealthcareApisService_Get : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -139,7 +159,8 @@ public partial class GetAzHealthcareApisService_Get : global::System.Management. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -148,24 +169,24 @@ public partial class GetAzHealthcareApisService_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IServicesDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription /// 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) @@ -188,6 +209,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -209,7 +235,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareApisService_Get() { @@ -260,8 +286,33 @@ public GetAzHealthcareApisService_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -314,7 +365,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,7 +386,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -373,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -395,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.HealthcareApis.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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 } }); @@ -413,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.HealthcareApis.Models.Api20211101.IServicesDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription /// 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 ) { @@ -430,8 +481,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisService_GetViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisService_GetViaIdentity.cs index d1d49a0781e8..e8ce424ccdc6 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisService_GetViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisService_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Get the metadata of a service instance. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareApisService_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader"}, ChangeDescription="The types of the properties 'PrivateEndpointConnection', 'AccessPolicy', 'AcrConfigurationOciArtifact', 'CorConfigurationOrigin', 'CorConfigurationMethod', 'AcrConfigurationLoginServer', and 'CorConfigurationHeader' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Get the metadata of a service instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareApisService_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzHealthcareApisService_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzHealthcareApisService_GetViaIdentity : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +107,7 @@ public partial class GetAzHealthcareApisService_GetViaIdentity : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +130,24 @@ public partial class GetAzHealthcareApisService_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IServicesDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription /// 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,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareApisService_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzHealthcareApisService_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -276,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -352,12 +402,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -374,7 +424,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -392,12 +442,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.HealthcareApis.Models.Api20211101.IServicesDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription /// 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 ) { @@ -409,8 +459,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisService_List.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisService_List.cs index 476c15ce56aa..70055db9c348 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisService_List.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisService_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Get all the service instances in a subscription. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/services" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareApisService_List")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader"}, ChangeDescription="The types of the properties 'PrivateEndpointConnection', 'AccessPolicy', 'AcrConfigurationOciArtifact', 'CorConfigurationOrigin', 'CorConfigurationMethod', 'AcrConfigurationLoginServer', and 'CorConfigurationHeader' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Get all the service instances in a subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/services", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareApisService_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +37,32 @@ public partial class GetAzHealthcareApisService_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzHealthcareApisService_List : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +105,7 @@ public partial class GetAzHealthcareApisService_List : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -117,7 +137,8 @@ public partial class GetAzHealthcareApisService_List : global::System.Management [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -126,24 +147,24 @@ public partial class GetAzHealthcareApisService_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IServicesDescriptionListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -166,6 +187,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -187,7 +213,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareApisService_List() { @@ -238,8 +264,33 @@ public GetAzHealthcareApisService_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -292,7 +343,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -351,12 +402,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -373,15 +424,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.HealthcareApis.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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 } }); @@ -391,12 +442,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.HealthcareApis.Models.Api20211101.IServicesDescriptionListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResult /// 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 ) { @@ -408,15 +459,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisService_List1.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisService_List1.cs index 20fa98857d24..f7702cde8c2c 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisService_List1.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisService_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Get all the service instances in a resource group. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareApisService_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader"}, ChangeDescription="The types of the properties 'PrivateEndpointConnection', 'AccessPolicy', 'AcrConfigurationOciArtifact', 'CorConfigurationOrigin', 'CorConfigurationMethod', 'AcrConfigurationLoginServer', and 'CorConfigurationHeader' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Get all the service instances in a resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareApisService_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +37,32 @@ public partial class GetAzHealthcareApisService_List1 : 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 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzHealthcareApisService_List1 : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +105,7 @@ public partial class GetAzHealthcareApisService_List1 : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -131,7 +151,8 @@ public partial class GetAzHealthcareApisService_List1 : global::System.Managemen [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -140,24 +161,24 @@ public partial class GetAzHealthcareApisService_List1 : 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IServicesDescriptionListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResult /// 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) @@ -180,6 +201,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -201,7 +227,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareApisService_List1() { @@ -252,8 +278,33 @@ public GetAzHealthcareApisService_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -365,12 +416,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -387,15 +438,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 } }); @@ -405,12 +456,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescriptionListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -422,15 +473,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescriptionListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisWorkspace_Get.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisWorkspace_Get.cs index b8539e675948..853a4ccb76a6 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisWorkspace_Get.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisWorkspace_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Gets the properties of the specified workspace. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareApisWorkspace_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection"}, NewOutputProperties=new string[] {"PrivateEndpointConnection"}, ChangeDescription="The types of the properties 'PrivateEndpointConnection' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the properties of the specified workspace.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareApisWorkspace_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzHealthcareApisWorkspace_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzHealthcareApisWorkspace_Get : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +114,7 @@ public partial class GetAzHealthcareApisWorkspace_Get : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -140,7 +160,8 @@ public partial class GetAzHealthcareApisWorkspace_Get : global::System.Managemen [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -149,24 +170,24 @@ public partial class GetAzHealthcareApisWorkspace_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IWorkspace + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace /// 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) @@ -189,6 +210,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -210,7 +236,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareApisWorkspace_Get() { @@ -261,8 +287,33 @@ public GetAzHealthcareApisWorkspace_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -315,7 +366,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -330,13 +381,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WorkspacesGet(ResourceGroupName, SubscriptionId, Name, onOk, onDefault, this, Pipeline); + await this.Client.WorkspacesGet(SubscriptionId, ResourceGroupName, Name, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,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 } }); @@ -374,12 +425,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -396,15 +447,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.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, 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 } }); @@ -414,12 +465,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.HealthcareApis.Models.Api20211101.IWorkspace + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace /// 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 ) { @@ -431,8 +482,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisWorkspace_GetViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisWorkspace_GetViaIdentity.cs index 697172290aea..62e59798e9f4 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisWorkspace_GetViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisWorkspace_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Gets the properties of the specified workspace. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareApisWorkspace_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection"}, NewOutputProperties=new string[] {"PrivateEndpointConnection"}, ChangeDescription="The types of the properties 'PrivateEndpointConnection' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the properties of the specified workspace.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareApisWorkspace_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzHealthcareApisWorkspace_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzHealthcareApisWorkspace_GetViaIdentity : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +107,7 @@ public partial class GetAzHealthcareApisWorkspace_GetViaIdentity : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +130,24 @@ public partial class GetAzHealthcareApisWorkspace_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IWorkspace + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace /// 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,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareApisWorkspace_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzHealthcareApisWorkspace_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -276,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -296,25 +346,25 @@ protected override void ProcessRecord() else { // try to call with PATH parameters from Input Object - 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.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.WorkspaceName) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.WorkspacesGet(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.WorkspaceName ?? null, onOk, onDefault, this, Pipeline); + await this.Client.WorkspacesGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WorkspaceName ?? null, onOk, onDefault, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -352,12 +402,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -374,7 +424,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -392,12 +442,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.HealthcareApis.Models.Api20211101.IWorkspace + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace /// 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 ) { @@ -409,8 +459,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisWorkspace_List.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisWorkspace_List.cs index f6e9c5199b7c..bd8185c2778b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisWorkspace_List.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisWorkspace_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Lists all the available workspaces under the specified subscription. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/workspaces" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareApisWorkspace_List")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection"}, NewOutputProperties=new string[] {"PrivateEndpointConnection"}, ChangeDescription="The types of the properties 'PrivateEndpointConnection' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Lists all the available workspaces under the specified subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/workspaces", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareApisWorkspace_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +37,32 @@ public partial class GetAzHealthcareApisWorkspace_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzHealthcareApisWorkspace_List : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +105,7 @@ public partial class GetAzHealthcareApisWorkspace_List : global::System.Manageme /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -117,7 +137,8 @@ public partial class GetAzHealthcareApisWorkspace_List : global::System.Manageme [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -126,24 +147,24 @@ public partial class GetAzHealthcareApisWorkspace_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IWorkspaceList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceList /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -166,6 +187,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -187,7 +213,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareApisWorkspace_List() { @@ -238,8 +264,33 @@ public GetAzHealthcareApisWorkspace_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -292,7 +343,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -351,12 +402,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -373,15 +424,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.HealthcareApis.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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 } }); @@ -391,12 +442,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.HealthcareApis.Models.Api20211101.IWorkspaceList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceList /// 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 ) { @@ -408,15 +459,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceList + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisWorkspace_List1.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisWorkspace_List1.cs index 10b307b3c098..3302026eeddd 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisWorkspace_List1.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareApisWorkspace_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Lists all the available workspaces under the specified resource group. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareApisWorkspace_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection"}, NewOutputProperties=new string[] {"PrivateEndpointConnection"}, ChangeDescription="The types of the properties 'PrivateEndpointConnection' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Lists all the available workspaces under the specified resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareApisWorkspace_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +37,32 @@ public partial class GetAzHealthcareApisWorkspace_List1 : 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 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzHealthcareApisWorkspace_List1 : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +105,7 @@ public partial class GetAzHealthcareApisWorkspace_List1 : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -131,7 +151,8 @@ public partial class GetAzHealthcareApisWorkspace_List1 : global::System.Managem [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -140,24 +161,24 @@ public partial class GetAzHealthcareApisWorkspace_List1 : 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IWorkspaceList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceList /// 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) @@ -180,6 +201,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -201,7 +227,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareApisWorkspace_List1() { @@ -252,8 +278,33 @@ public GetAzHealthcareApisWorkspace_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -365,12 +416,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -387,15 +438,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 } }); @@ -405,12 +456,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspaceList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceList /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -422,15 +473,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspaceList + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareDicomService_Get.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareDicomService_Get.cs index 94e588d2ecd1..5cfb5ed9c662 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareDicomService_Get.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareDicomService_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Gets the properties of the specified DICOM Service. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareDicomService_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","AuthenticationConfigurationAudience","IdentityType","IdentityUserAssignedIdentity"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","AuthenticationConfigurationAudience","IdentityType","IdentityUserAssignedIdentity"}, ChangeDescription="(1)The types of the properties 'PrivateEndpointConnection' and 'AuthenticationConfigurationAudience' will be changed from single object to 'List'. (2)IdentityType will be removed. EnableSystemAssignedIdentity will be used to enable/disable system assigned identity and UserAssignedIdentity will be used to specify user assigned identities.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the properties of the specified DICOM Service.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareDicomService_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzHealthcareDicomService_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzHealthcareDicomService_Get : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +114,7 @@ public partial class GetAzHealthcareDicomService_Get : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -140,7 +160,8 @@ public partial class GetAzHealthcareDicomService_Get : global::System.Management [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -163,24 +184,24 @@ public partial class GetAzHealthcareDicomService_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IDicomService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService /// 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) @@ -203,6 +224,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -224,7 +250,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareDicomService_Get() { @@ -275,8 +301,33 @@ public GetAzHealthcareDicomService_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -329,7 +380,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -344,13 +395,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.DicomServicesGet(ResourceGroupName, SubscriptionId, WorkspaceName, Name, onOk, onDefault, this, Pipeline); + await this.Client.DicomServicesGet(SubscriptionId, ResourceGroupName, WorkspaceName, Name, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,WorkspaceName=WorkspaceName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -388,12 +439,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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,15 +461,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.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName, 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 } }); @@ -428,12 +479,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.HealthcareApis.Models.Api20211101.IDicomService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService /// 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 ) { @@ -445,8 +496,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareDicomService_GetViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareDicomService_GetViaIdentity.cs index 80a83acfe70c..fad15ab611c3 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareDicomService_GetViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareDicomService_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Gets the properties of the specified DICOM Service. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareDicomService_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","AuthenticationConfigurationAudience","IdentityType","IdentityUserAssignedIdentity"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","AuthenticationConfigurationAudience","IdentityType","IdentityUserAssignedIdentity"}, ChangeDescription="(1)The types of the properties 'PrivateEndpointConnection' and 'AuthenticationConfigurationAudience' will be changed from single object to 'List'. (2)IdentityType will be removed. EnableSystemAssignedIdentity will be used to enable/disable system assigned identity and UserAssignedIdentity will be used to specify user assigned identities.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the properties of the specified DICOM Service.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareDicomService_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzHealthcareDicomService_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzHealthcareDicomService_GetViaIdentity : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +107,7 @@ public partial class GetAzHealthcareDicomService_GetViaIdentity : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +130,24 @@ public partial class GetAzHealthcareDicomService_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IDicomService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService /// 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,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareDicomService_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzHealthcareDicomService_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -276,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -296,14 +346,14 @@ protected override void ProcessRecord() else { // try to call with PATH parameters from Input Object - 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.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.WorkspaceName) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); @@ -312,13 +362,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DicomServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.DicomServicesGet(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.WorkspaceName ?? null, InputObject.DicomServiceName ?? null, onOk, onDefault, this, Pipeline); + await this.Client.DicomServicesGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WorkspaceName ?? null, InputObject.DicomServiceName ?? null, onOk, onDefault, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -356,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -378,7 +428,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -396,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.HealthcareApis.Models.Api20211101.IDicomService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService /// 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 ) { @@ -413,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareDicomService_GetViaIdentityWorkspace.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareDicomService_GetViaIdentityWorkspace.cs new file mode 100644 index 000000000000..21dbfffce7bd --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareDicomService_GetViaIdentityWorkspace.cs @@ -0,0 +1,501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// Gets the properties of the specified DICOM Service. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareDicomService_GetViaIdentityWorkspace")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the properties of the specified DICOM Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", ApiVersion = "2021-11-01")] + public partial class GetAzHealthcareDicomService_GetViaIdentityWorkspace : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of DICOM Service resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of DICOM Service resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of DICOM Service resource.", + SerializedName = @"dicomServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DicomServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _workspaceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity WorkspaceInputObject { get => this._workspaceInputObject; set => this._workspaceInputObject = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IDicomService + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzHealthcareDicomService_GetViaIdentityWorkspace() + { + + } + + /// 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.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (WorkspaceInputObject?.Id != null) + { + this.WorkspaceInputObject.Id += $"/dicomservices/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.DicomServicesGetViaIdentity(WorkspaceInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == WorkspaceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + await this.Client.DicomServicesGet(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IDicomService + /// 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.HealthcareApis.Models.IDicomService + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareDicomService_List.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareDicomService_List.cs index 96fd4533a69e..e4ab13b49789 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareDicomService_List.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareDicomService_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Lists all DICOM Services for the given workspace @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] ListByWorkspace=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareDicomService_List")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","AuthenticationConfigurationAudience","IdentityType","IdentityUserAssignedIdentity"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","AuthenticationConfigurationAudience","IdentityType","IdentityUserAssignedIdentity"}, ChangeDescription="(1)The types of the properties 'PrivateEndpointConnection' and 'AuthenticationConfigurationAudience' will be changed from single object to 'List'. (2)IdentityType will be removed. EnableSystemAssignedIdentity will be used to enable/disable system assigned identity and UserAssignedIdentity will be used to specify user assigned identities.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Lists all DICOM Services for the given workspace")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareDicomService_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +37,32 @@ public partial class GetAzHealthcareDicomService_List : 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 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzHealthcareDicomService_List : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +105,7 @@ public partial class GetAzHealthcareDicomService_List : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -131,7 +151,8 @@ public partial class GetAzHealthcareDicomService_List : global::System.Managemen [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -154,24 +175,24 @@ public partial class GetAzHealthcareDicomService_List : 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IDicomServiceCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollection /// 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) @@ -194,6 +215,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -215,7 +241,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareDicomService_List() { @@ -266,8 +292,33 @@ public GetAzHealthcareDicomService_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -320,7 +371,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,13 +386,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.DicomServicesListByWorkspace(ResourceGroupName, SubscriptionId, WorkspaceName, onOk, onDefault, this, Pipeline); + await this.Client.DicomServicesListByWorkspace(SubscriptionId, ResourceGroupName, WorkspaceName, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,WorkspaceName=WorkspaceName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -379,12 +430,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -401,15 +452,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.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName }) + 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 } }); @@ -419,12 +470,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.HealthcareApis.Models.Api20211101.IDicomServiceCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollection /// 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 ) { @@ -436,15 +487,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomServiceCollection + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirDestination_List.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirDestination_List.cs index 7ff8567dda00..6072d1ff0954 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirDestination_List.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirDestination_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Lists all FHIR destinations for the given IoT Connector @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] ListByIotConnector=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareFhirDestination_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Lists all FHIR destinations for the given IoT Connector")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareFhirDestination_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzHealthcareFhirDestination_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzHealthcareFhirDestination_List : global::System.Manage [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -98,7 +119,7 @@ public partial class GetAzHealthcareFhirDestination_List : global::System.Manage /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -144,7 +165,8 @@ public partial class GetAzHealthcareFhirDestination_List : global::System.Manage [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -167,24 +189,24 @@ public partial class GetAzHealthcareFhirDestination_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollection /// 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,6 +229,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -228,7 +255,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareFhirDestination_List() { @@ -279,8 +306,33 @@ public GetAzHealthcareFhirDestination_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -333,7 +385,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -348,13 +400,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.FhirDestinationsListByIotConnector(ResourceGroupName, SubscriptionId, WorkspaceName, IotConnectorName, onOk, onDefault, this, Pipeline); + await this.Client.FhirDestinationsListByIotConnector(SubscriptionId, ResourceGroupName, WorkspaceName, IotConnectorName, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,WorkspaceName=WorkspaceName,IotConnectorName=IotConnectorName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName,IotConnectorName=IotConnectorName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -392,12 +444,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -414,15 +466,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName, IotConnectorName=IotConnectorName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName, IotConnectorName=IotConnectorName }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -432,12 +484,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestinationCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollection /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -449,15 +501,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestinationCollection + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirService_Get.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirService_Get.cs index c4498c9af8ec..b90725d5b34a 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirService_Get.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirService_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Gets the properties of the specified FHIR Service. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareFhirService_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader","IdentityType","IdentityUserAssignedIdentity"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader","IdentityType","IdentityUserAssignedIdentity"}, ChangeDescription="(1)The types of the properties 'PrivateEndpointConnection' and 'AuthenticationConfigurationAudience' will be changed from single object to 'List'. (2)IdentityType will be removed. EnableSystemAssignedIdentity will be used to enable/disable system assigned identity and UserAssignedIdentity will be used to specify user assigned identities.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the properties of the specified FHIR Service.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareFhirService_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzHealthcareFhirService_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzHealthcareFhirService_Get : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +114,7 @@ public partial class GetAzHealthcareFhirService_Get : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -140,7 +160,8 @@ public partial class GetAzHealthcareFhirService_Get : global::System.Management. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -163,24 +184,24 @@ public partial class GetAzHealthcareFhirService_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IFhirService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService /// 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) @@ -203,6 +224,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -224,7 +250,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareFhirService_Get() { @@ -275,8 +301,33 @@ public GetAzHealthcareFhirService_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -329,7 +380,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -344,13 +395,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.FhirServicesGet(ResourceGroupName, SubscriptionId, WorkspaceName, Name, onOk, onDefault, this, Pipeline); + await this.Client.FhirServicesGet(SubscriptionId, ResourceGroupName, WorkspaceName, Name, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,WorkspaceName=WorkspaceName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -388,12 +439,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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,15 +461,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.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName, 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 } }); @@ -428,12 +479,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.HealthcareApis.Models.Api20211101.IFhirService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService /// 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 ) { @@ -445,8 +496,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirService_GetViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirService_GetViaIdentity.cs index 83a779b3e59f..8031d9dd811e 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirService_GetViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirService_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Gets the properties of the specified FHIR Service. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareFhirService_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader","IdentityType","IdentityUserAssignedIdentity"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader","IdentityType","IdentityUserAssignedIdentity"}, ChangeDescription="(1)The types of the properties 'PrivateEndpointConnection' and 'AuthenticationConfigurationAudience' will be changed from single object to 'List'. (2)IdentityType will be removed. EnableSystemAssignedIdentity will be used to enable/disable system assigned identity and UserAssignedIdentity will be used to specify user assigned identities.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the properties of the specified FHIR Service.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareFhirService_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzHealthcareFhirService_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzHealthcareFhirService_GetViaIdentity : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +107,7 @@ public partial class GetAzHealthcareFhirService_GetViaIdentity : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +130,24 @@ public partial class GetAzHealthcareFhirService_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IFhirService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService /// 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,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareFhirService_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzHealthcareFhirService_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -276,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -296,14 +346,14 @@ protected override void ProcessRecord() else { // try to call with PATH parameters from Input Object - 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.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.WorkspaceName) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); @@ -312,13 +362,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FhirServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.FhirServicesGet(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.WorkspaceName ?? null, InputObject.FhirServiceName ?? null, onOk, onDefault, this, Pipeline); + await this.Client.FhirServicesGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WorkspaceName ?? null, InputObject.FhirServiceName ?? null, onOk, onDefault, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -356,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -378,7 +428,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -396,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.HealthcareApis.Models.Api20211101.IFhirService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService /// 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 ) { @@ -413,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateLinkResource_GetViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirService_GetViaIdentityWorkspace.cs similarity index 75% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateLinkResource_GetViaIdentity.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirService_GetViaIdentityWorkspace.cs index 7d7729a700d8..15aa8d80de44 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateLinkResource_GetViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirService_GetViaIdentityWorkspace.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Gets a private link resource that need to be created for a service. + /// Gets the properties of the specified FHIR Service. /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources/{groupName}" + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}" /// - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcarePrivateLinkResource_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets a private link resource that need to be created for a service.")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareFhirService_GetViaIdentityWorkspace")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the properties of the specified FHIR Service.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources/{groupName}", ApiVersion = "2021-11-01")] - public partial class GetAzHealthcarePrivateLinkResource_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", ApiVersion = "2021-11-01")] + public partial class GetAzHealthcareFhirService_GetViaIdentityWorkspace : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzHealthcarePrivateLinkResource_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzHealthcarePrivateLinkResource_GetViaIdentity : global: [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -65,14 +85,6 @@ public partial class GetAzHealthcarePrivateLinkResource_GetViaIdentity : global: [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity 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; } } @@ -84,10 +96,25 @@ public partial class GetAzHealthcarePrivateLinkResource_GetViaIdentity : global: /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + /// Backing field for property. + private string _name; + + /// The name of FHIR Service resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of FHIR Service resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of FHIR Service resource.", + SerializedName = @"fhirServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("FhirServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -105,29 +132,37 @@ public partial class GetAzHealthcarePrivateLinkResource_GetViaIdentity : global: [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _workspaceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity WorkspaceInputObject { get => this._workspaceInputObject; set => this._workspaceInputObject = 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService /// 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,6 +185,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,9 +211,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public GetAzHealthcarePrivateLinkResource_GetViaIdentity() + public GetAzHealthcareFhirService_GetViaIdentityWorkspace() { } @@ -222,8 +262,33 @@ public GetAzHealthcarePrivateLinkResource_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -276,7 +341,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -289,36 +354,33 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) + if (WorkspaceInputObject?.Id != null) { - await this.Client.PrivateLinkResourcesGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + this.WorkspaceInputObject.Id += $"/fhirservices/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.FhirServicesGetViaIdentity(WorkspaceInputObject.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) + if (null == WorkspaceInputObject.SubscriptionId) { - 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) ); + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); } - if (null == InputObject.ResourceName) + if (null == WorkspaceInputObject.ResourceGroupName) { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); } - if (null == InputObject.GroupName) + if (null == WorkspaceInputObject.WorkspaceName) { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); } - await this.Client.PrivateLinkResourcesGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.GroupName ?? null, onOk, onDefault, this, Pipeline); + await this.Client.FhirServicesGet(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, Name, onOk, onDefault, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 { Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -356,12 +418,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -378,7 +440,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -396,12 +458,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.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService /// 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 ) { @@ -413,8 +475,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirService_List.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirService_List.cs index ad785855806c..e03a6d26201b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirService_List.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareFhirService_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Lists all FHIR Services for the given workspace @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] ListByWorkspace=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareFhirService_List")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader","IdentityType","IdentityUserAssignedIdentity"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader","IdentityType","IdentityUserAssignedIdentity"}, ChangeDescription="(1)The types of the properties 'PrivateEndpointConnection' and 'AuthenticationConfigurationAudience' will be changed from single object to 'List'. (2)IdentityType will be removed. EnableSystemAssignedIdentity will be used to enable/disable system assigned identity and UserAssignedIdentity will be used to specify user assigned identities.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Lists all FHIR Services for the given workspace")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareFhirService_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +37,32 @@ public partial class GetAzHealthcareFhirService_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzHealthcareFhirService_List : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +105,7 @@ public partial class GetAzHealthcareFhirService_List : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -131,7 +151,8 @@ public partial class GetAzHealthcareFhirService_List : global::System.Management [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -154,24 +175,24 @@ public partial class GetAzHealthcareFhirService_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IFhirServiceCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollection /// 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) @@ -194,6 +215,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -215,7 +241,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareFhirService_List() { @@ -266,8 +292,33 @@ public GetAzHealthcareFhirService_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -320,7 +371,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,13 +386,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.FhirServicesListByWorkspace(ResourceGroupName, SubscriptionId, WorkspaceName, onOk, onDefault, this, Pipeline); + await this.Client.FhirServicesListByWorkspace(SubscriptionId, ResourceGroupName, WorkspaceName, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,WorkspaceName=WorkspaceName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -379,12 +430,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -401,15 +452,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.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName }) + 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 } }); @@ -419,12 +470,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.HealthcareApis.Models.Api20211101.IFhirServiceCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollection /// 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 ) { @@ -436,15 +487,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceCollection + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnectorFhirDestination_Get.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnectorFhirDestination_Get.cs index 9ee3a407d55b..252b3e4b6534 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnectorFhirDestination_Get.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnectorFhirDestination_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Gets the properties of the specified Iot Connector FHIR destination. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareIotConnectorFhirDestination_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the properties of the specified Iot Connector FHIR destination.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareIotConnectorFhirDestination_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzHealthcareIotConnectorFhirDestination_Get : 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; + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzHealthcareIotConnectorFhirDestination_Get : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 _fhirDestinationName; @@ -106,7 +127,7 @@ public partial class GetAzHealthcareIotConnectorFhirDestination_Get : global::Sy /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -152,7 +173,8 @@ public partial class GetAzHealthcareIotConnectorFhirDestination_Get : global::Sy [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -175,24 +197,24 @@ public partial class GetAzHealthcareIotConnectorFhirDestination_Get : 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IIotFhirDestination + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination /// 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,6 +237,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -236,7 +263,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareIotConnectorFhirDestination_Get() { @@ -287,8 +314,33 @@ public GetAzHealthcareIotConnectorFhirDestination_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -341,7 +393,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -356,13 +408,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.IotConnectorFhirDestinationGet(ResourceGroupName, SubscriptionId, WorkspaceName, IotConnectorName, FhirDestinationName, onOk, onDefault, this, Pipeline); + await this.Client.IotConnectorFhirDestinationGet(SubscriptionId, ResourceGroupName, WorkspaceName, IotConnectorName, FhirDestinationName, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,WorkspaceName=WorkspaceName,IotConnectorName=IotConnectorName,FhirDestinationName=FhirDestinationName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName,IotConnectorName=IotConnectorName,FhirDestinationName=FhirDestinationName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -400,12 +452,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -422,15 +474,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.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName, IotConnectorName=IotConnectorName, FhirDestinationName=FhirDestinationName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName, IotConnectorName=IotConnectorName, FhirDestinationName=FhirDestinationName }) + 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 } }); @@ -440,12 +492,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.HealthcareApis.Models.Api20211101.IIotFhirDestination + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination /// 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 ) { @@ -457,8 +509,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnectorFhirDestination_GetViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnectorFhirDestination_GetViaIdentity.cs index 5b7f8de65f4a..f09e27e070e1 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnectorFhirDestination_GetViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnectorFhirDestination_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Gets the properties of the specified Iot Connector FHIR destination. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareIotConnectorFhirDestination_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the properties of the specified Iot Connector FHIR destination.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareIotConnectorFhirDestination_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzHealthcareIotConnectorFhirDestination_GetViaIdentity : /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzHealthcareIotConnectorFhirDestination_GetViaIdentity : [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -86,7 +107,7 @@ public partial class GetAzHealthcareIotConnectorFhirDestination_GetViaIdentity : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -109,24 +130,24 @@ public partial class GetAzHealthcareIotConnectorFhirDestination_GetViaIdentity : /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IIotFhirDestination + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination /// 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) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareIotConnectorFhirDestination_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzHealthcareIotConnectorFhirDestination_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -295,14 +346,14 @@ protected override void ProcessRecord() else { // try to call with PATH parameters from Input Object - 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.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.WorkspaceName) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); @@ -315,13 +366,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FhirDestinationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.IotConnectorFhirDestinationGet(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.WorkspaceName ?? null, InputObject.IotConnectorName ?? null, InputObject.FhirDestinationName ?? null, onOk, onDefault, this, Pipeline); + await this.Client.IotConnectorFhirDestinationGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WorkspaceName ?? null, InputObject.IotConnectorName ?? null, InputObject.FhirDestinationName ?? null, onOk, onDefault, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -359,12 +410,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -381,7 +432,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -399,12 +450,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.HealthcareApis.Models.Api20211101.IIotFhirDestination + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination /// 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 ) { @@ -416,8 +467,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnectorFhirDestination_GetViaIdentityIotconnector.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnectorFhirDestination_GetViaIdentityIotconnector.cs new file mode 100644 index 000000000000..c316978906a0 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnectorFhirDestination_GetViaIdentityIotconnector.cs @@ -0,0 +1,505 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// Gets the properties of the specified Iot Connector FHIR destination. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareIotConnectorFhirDestination_GetViaIdentityIotconnector")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the properties of the specified Iot Connector FHIR destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", ApiVersion = "2021-11-01")] + public partial class GetAzHealthcareIotConnectorFhirDestination_GetViaIdentityIotconnector : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 _fhirDestinationName; + + /// The name of IoT Connector FHIR destination resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector FHIR destination resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector FHIR destination resource.", + SerializedName = @"fhirDestinationName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string FhirDestinationName { get => this._fhirDestinationName; set => this._fhirDestinationName = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _iotconnectorInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity IotconnectorInputObject { get => this._iotconnectorInputObject; set => this._iotconnectorInputObject = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Initializes a new instance of the + /// cmdlet class. + /// + public GetAzHealthcareIotConnectorFhirDestination_GetViaIdentityIotconnector() + { + + } + + /// 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.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (IotconnectorInputObject?.Id != null) + { + this.IotconnectorInputObject.Id += $"/fhirdestinations/{(global::System.Uri.EscapeDataString(this.FhirDestinationName.ToString()))}"; + await this.Client.IotConnectorFhirDestinationGetViaIdentity(IotconnectorInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == IotconnectorInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + if (null == IotconnectorInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + if (null == IotconnectorInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + if (null == IotconnectorInputObject.IotConnectorName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.IotConnectorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + await this.Client.IotConnectorFhirDestinationGet(IotconnectorInputObject.SubscriptionId ?? null, IotconnectorInputObject.ResourceGroupName ?? null, IotconnectorInputObject.WorkspaceName ?? null, IotconnectorInputObject.IotConnectorName ?? null, FhirDestinationName, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { FhirDestinationName=FhirDestinationName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Models.IIotFhirDestination + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnectorFhirDestination_GetViaIdentityWorkspace.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnectorFhirDestination_GetViaIdentityWorkspace.cs new file mode 100644 index 000000000000..1c5ed184ba0a --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnectorFhirDestination_GetViaIdentityWorkspace.cs @@ -0,0 +1,515 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// Gets the properties of the specified Iot Connector FHIR destination. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareIotConnectorFhirDestination_GetViaIdentityWorkspace")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the properties of the specified Iot Connector FHIR destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", ApiVersion = "2021-11-01")] + public partial class GetAzHealthcareIotConnectorFhirDestination_GetViaIdentityWorkspace : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 _fhirDestinationName; + + /// The name of IoT Connector FHIR destination resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector FHIR destination resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector FHIR destination resource.", + SerializedName = @"fhirDestinationName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string FhirDestinationName { get => this._fhirDestinationName; set => this._fhirDestinationName = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _iotConnectorName; + + /// The name of IoT Connector resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector resource.", + SerializedName = @"iotConnectorName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string IotConnectorName { get => this._iotConnectorName; set => this._iotConnectorName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _workspaceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity WorkspaceInputObject { get => this._workspaceInputObject; set => this._workspaceInputObject = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public GetAzHealthcareIotConnectorFhirDestination_GetViaIdentityWorkspace() + { + + } + + /// 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.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (WorkspaceInputObject?.Id != null) + { + this.WorkspaceInputObject.Id += $"/iotconnectors/{(global::System.Uri.EscapeDataString(this.IotConnectorName.ToString()))}/fhirdestinations/{(global::System.Uri.EscapeDataString(this.FhirDestinationName.ToString()))}"; + await this.Client.IotConnectorFhirDestinationGetViaIdentity(WorkspaceInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == WorkspaceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + await this.Client.IotConnectorFhirDestinationGet(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, IotConnectorName, FhirDestinationName, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IotConnectorName=IotConnectorName,FhirDestinationName=FhirDestinationName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Models.IIotFhirDestination + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnector_Get.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnector_Get.cs index 95c2207433ca..ae25c5f8fb34 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnector_Get.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnector_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Gets the properties of the specified IoT Connector. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareIotConnector_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the properties of the specified IoT Connector.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareIotConnector_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzHealthcareIotConnector_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzHealthcareIotConnector_Get : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -93,7 +114,7 @@ public partial class GetAzHealthcareIotConnector_Get : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -139,7 +160,8 @@ public partial class GetAzHealthcareIotConnector_Get : global::System.Management [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -162,24 +184,24 @@ public partial class GetAzHealthcareIotConnector_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IIotConnector + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector /// 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,6 +224,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -223,7 +250,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareIotConnector_Get() { @@ -274,8 +301,33 @@ public GetAzHealthcareIotConnector_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -328,7 +380,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -343,13 +395,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.IotConnectorsGet(ResourceGroupName, SubscriptionId, WorkspaceName, Name, onOk, onDefault, this, Pipeline); + await this.Client.IotConnectorsGet(SubscriptionId, ResourceGroupName, WorkspaceName, Name, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,WorkspaceName=WorkspaceName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -387,12 +439,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -409,15 +461,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.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName, 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 } }); @@ -427,12 +479,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.HealthcareApis.Models.Api20211101.IIotConnector + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector /// 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 ) { @@ -444,8 +496,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnector_GetViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnector_GetViaIdentity.cs index ca001e519758..0be1b7c0bf04 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnector_GetViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnector_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Gets the properties of the specified IoT Connector. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareIotConnector_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the properties of the specified IoT Connector.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareIotConnector_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzHealthcareIotConnector_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzHealthcareIotConnector_GetViaIdentity : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -86,7 +107,7 @@ public partial class GetAzHealthcareIotConnector_GetViaIdentity : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -109,24 +130,24 @@ public partial class GetAzHealthcareIotConnector_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IIotConnector + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector /// 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) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareIotConnector_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzHealthcareIotConnector_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -295,14 +346,14 @@ protected override void ProcessRecord() else { // try to call with PATH parameters from Input Object - 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.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.WorkspaceName) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); @@ -311,13 +362,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.IotConnectorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.IotConnectorsGet(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.WorkspaceName ?? null, InputObject.IotConnectorName ?? null, onOk, onDefault, this, Pipeline); + await this.Client.IotConnectorsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WorkspaceName ?? null, InputObject.IotConnectorName ?? null, onOk, onDefault, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -355,12 +406,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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,7 +428,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -395,12 +446,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -412,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnector_GetViaIdentityWorkspace.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnector_GetViaIdentityWorkspace.cs new file mode 100644 index 000000000000..ec013a7d4e97 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnector_GetViaIdentityWorkspace.cs @@ -0,0 +1,501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// Gets the properties of the specified IoT Connector. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareIotConnector_GetViaIdentityWorkspace")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the properties of the specified IoT Connector.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", ApiVersion = "2021-11-01")] + public partial class GetAzHealthcareIotConnector_GetViaIdentityWorkspace : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of IoT Connector resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector resource.", + SerializedName = @"iotConnectorName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("IotConnectorName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _workspaceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity WorkspaceInputObject { get => this._workspaceInputObject; set => this._workspaceInputObject = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IIotConnector + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzHealthcareIotConnector_GetViaIdentityWorkspace() + { + + } + + /// 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.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (WorkspaceInputObject?.Id != null) + { + this.WorkspaceInputObject.Id += $"/iotconnectors/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.IotConnectorsGetViaIdentity(WorkspaceInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == WorkspaceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + await this.Client.IotConnectorsGet(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IIotConnector + /// 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.HealthcareApis.Models.IIotConnector + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnector_List.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnector_List.cs index f2140a20aae9..b32ab6a084ae 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnector_List.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareIotConnector_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Lists all IoT Connectors for the given workspace @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] ListByWorkspace=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareIotConnector_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Lists all IoT Connectors for the given workspace")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareIotConnector_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzHealthcareIotConnector_List : 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 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzHealthcareIotConnector_List : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +105,7 @@ public partial class GetAzHealthcareIotConnector_List : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -130,7 +151,8 @@ public partial class GetAzHealthcareIotConnector_List : global::System.Managemen [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -153,24 +175,24 @@ public partial class GetAzHealthcareIotConnector_List : 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IIotConnectorCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollection /// 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) @@ -193,6 +215,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -214,7 +241,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareIotConnector_List() { @@ -265,8 +292,33 @@ public GetAzHealthcareIotConnector_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -319,7 +371,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -334,13 +386,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.IotConnectorsListByWorkspace(ResourceGroupName, SubscriptionId, WorkspaceName, onOk, onDefault, this, Pipeline); + await this.Client.IotConnectorsListByWorkspace(SubscriptionId, ResourceGroupName, WorkspaceName, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,WorkspaceName=WorkspaceName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -378,12 +430,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -400,15 +452,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.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName }) + 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 } }); @@ -418,12 +470,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.HealthcareApis.Models.Api20211101.IIotConnectorCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollection /// 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 ) { @@ -435,15 +487,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnectorCollection + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareOperationResult_Get.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareOperationResult_Get.cs index 1d162ea76da8..0fd47a55eb62 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareOperationResult_Get.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareOperationResult_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Get the operation result for a long running operation. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareOperationResult_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescription))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Get the operation result for a long running operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/operationresults/{operationResultId}", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareOperationResult_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzHealthcareOperationResult_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzHealthcareOperationResult_Get : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +129,7 @@ public partial class GetAzHealthcareOperationResult_Get : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -140,7 +161,8 @@ public partial class GetAzHealthcareOperationResult_Get : global::System.Managem [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -149,24 +171,24 @@ public partial class GetAzHealthcareOperationResult_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IOperationResultsDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription /// 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) @@ -189,6 +211,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -210,7 +237,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareOperationResult_Get() { @@ -261,8 +288,33 @@ public GetAzHealthcareOperationResult_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -315,7 +367,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -336,7 +388,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,LocationName=LocationName,Id=Id}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,LocationName=LocationName,Id=Id}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -374,12 +426,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -396,15 +448,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, LocationName=LocationName, Id=Id }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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, LocationName=LocationName, 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 } }); @@ -414,12 +466,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.HealthcareApis.Models.Api20211101.IOperationResultsDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription /// 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 ) { @@ -431,8 +483,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescription - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareOperationResult_GetViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareOperationResult_GetViaIdentity.cs index da1996336f92..f3ee16bce738 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareOperationResult_GetViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareOperationResult_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Get the operation result for a long running operation. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareOperationResult_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescription))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Get the operation result for a long running operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/operationresults/{operationResultId}", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareOperationResult_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzHealthcareOperationResult_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzHealthcareOperationResult_GetViaIdentity : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +108,7 @@ public partial class GetAzHealthcareOperationResult_GetViaIdentity : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +131,24 @@ public partial class GetAzHealthcareOperationResult_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IOperationResultsDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription /// 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,6 +171,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +197,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareOperationResult_GetViaIdentity() { @@ -222,8 +248,33 @@ public GetAzHealthcareOperationResult_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -276,7 +327,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -352,12 +403,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -374,7 +425,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -392,12 +443,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.HealthcareApis.Models.Api20211101.IOperationResultsDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription /// 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 ) { @@ -409,8 +460,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescription - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateEndpointConnection_GetViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareOperationResult_GetViaIdentityLocation.cs similarity index 75% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateEndpointConnection_GetViaIdentity.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareOperationResult_GetViaIdentityLocation.cs index abaad82518bd..4717e8329f63 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateEndpointConnection_GetViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareOperationResult_GetViaIdentityLocation.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Gets the specified private endpoint connection associated with the service. + /// Get the operation result for a long running operation. /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/operationresults/{operationResultId}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcarePrivateEndpointConnection_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the specified private endpoint connection associated with the service.")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareOperationResult_GetViaIdentityLocation")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Get the operation result for a long running operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2021-11-01")] - public partial class GetAzHealthcarePrivateEndpointConnection_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/operationresults/{operationResultId}", ApiVersion = "2021-11-01")] + public partial class GetAzHealthcareOperationResult_GetViaIdentityLocation : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzHealthcarePrivateEndpointConnection_GetViaIdentity : 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; + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzHealthcarePrivateEndpointConnection_GetViaIdentity : g [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -65,17 +86,32 @@ public partial class GetAzHealthcarePrivateEndpointConnection_GetViaIdentity : g [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + /// Backing field for property. + private string _id; + + /// The ID of the operation result to get. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the operation result to get.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the operation result to get.", + SerializedName = @"operationResultId", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("OperationResultId")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + 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; } } + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _locationInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity LocationInputObject { get => this._locationInputObject; set => this._locationInputObject = value; } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -87,7 +123,7 @@ public partial class GetAzHealthcarePrivateEndpointConnection_GetViaIdentity : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +146,24 @@ public partial class GetAzHealthcarePrivateEndpointConnection_GetViaIdentity : 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription /// 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,6 +186,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,9 +212,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public GetAzHealthcarePrivateEndpointConnection_GetViaIdentity() + public GetAzHealthcareOperationResult_GetViaIdentityLocation() { } @@ -222,8 +263,33 @@ public GetAzHealthcarePrivateEndpointConnection_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -276,7 +342,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -289,36 +355,29 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) + if (LocationInputObject?.Id != null) { - await this.Client.PrivateEndpointConnectionsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + this.LocationInputObject.Id += $"/operationresults/{(global::System.Uri.EscapeDataString(this.Id.ToString()))}"; + await this.Client.OperationResultsGetViaIdentity(LocationInputObject.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.ResourceName) + if (null == LocationInputObject.SubscriptionId) { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("LocationInputObject has null value for LocationInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, LocationInputObject) ); } - if (null == InputObject.PrivateEndpointConnectionName) + if (null == LocationInputObject.LocationName) { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateEndpointConnectionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("LocationInputObject has null value for LocationInputObject.LocationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, LocationInputObject) ); } - await this.Client.PrivateEndpointConnectionsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.PrivateEndpointConnectionName ?? null, onOk, onDefault, this, Pipeline); + await this.Client.OperationResultsGet(LocationInputObject.SubscriptionId ?? null, LocationInputObject.LocationName ?? null, Id, onOk, onDefault, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 { Id=Id}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -356,12 +415,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -378,7 +437,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -396,12 +455,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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription /// 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 ) { @@ -413,8 +472,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareOperation_List.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareOperation_List.cs index 11aaf96490cb..43ed2993f6df 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareOperation_List.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareOperation_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareOperation_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetail))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Lists all of the available operations supported by Microsoft Healthcare resource provider.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/providers/Microsoft.HealthcareApis/operations", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareOperation_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,17 +40,32 @@ public partial class GetAzHealthcareOperation_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -61,6 +79,9 @@ public partial class GetAzHealthcareOperation_List : global::System.Management.A [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +108,7 @@ public partial class GetAzHealthcareOperation_List : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +131,24 @@ public partial class GetAzHealthcareOperation_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IListOperations + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperations /// 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,6 +171,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +197,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareOperation_List() { @@ -222,8 +248,33 @@ public GetAzHealthcareOperation_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -276,7 +327,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -294,7 +345,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -332,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -354,7 +405,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -372,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.HealthcareApis.Models.Api20211101.IListOperations + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperations /// 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 ) { @@ -389,15 +440,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IListOperations + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateEndpointConnection_List.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateEndpointConnection_List.cs deleted file mode 100644 index 3e02108248bb..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateEndpointConnection_List.cs +++ /dev/null @@ -1,439 +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.HealthcareApis.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; - using System; - - /// Lists all private endpoint connections for a service. - /// - /// [OpenAPI] ListByService=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections" - /// - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcarePrivateEndpointConnection_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Lists all private endpoint connections for a service.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections", ApiVersion = "2021-11-01")] - public partial class GetAzHealthcarePrivateEndpointConnection_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener - { - /// 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(); - - /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// SendAsync Pipeline Steps to be appended to the front of 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// The instance of the that the remote call will use. - /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// Backing field for property. - private string _resourceGroupName; - - /// The name of the resource group that contains the service instance. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group that contains the service instance.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] - public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - - /// Backing field for property. - private string _resourceName; - - /// The name of the service instance. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the service instance.")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the service instance.", - SerializedName = @"resourceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] - public string ResourceName { get => this._resourceName; set => this._resourceName = value; } - - /// Backing field for property. - private string[] _subscriptionId; - - /// The subscription identifier. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The subscription identifier.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IErrorDetails - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultDescription - /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); - if (telemetryInfo != null) - { - telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); - telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); - telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (showSecretsWarning == "true") - { - if (string.IsNullOrEmpty(sanitizedProperties)) - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - else - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - } - } - } - - /// - /// Intializes a new instance of the cmdlet class. - /// - public GetAzHealthcarePrivateEndpointConnection_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.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Information: - { - var data = messageData(); - WriteInformation(data.Message, new string[]{}); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - foreach( var SubscriptionId in this.SubscriptionId ) - { - await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PrivateEndpointConnectionsListByService(SubscriptionId, ResourceGroupName, ResourceName, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,ResourceName=ResourceName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline, enumerateCollection); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails - /// from the remote call - /// - /// A that will be complete when handling of 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.HealthcareApis.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, ResourceName=ResourceName }) - { - 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, ResourceName=ResourceName }) - { - 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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultDescription - /// 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 - // response should be returning an array of some kind. +Pageable - // pageable / value / - WriteObject((await response).Value, true); - } - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateLinkResource_List.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateLinkResource_List.cs deleted file mode 100644 index 3e2e8d29ed8d..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateLinkResource_List.cs +++ /dev/null @@ -1,439 +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.HealthcareApis.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; - using System; - - /// Gets the private link resources that need to be created for a service. - /// - /// [OpenAPI] ListByService=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources" - /// - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcarePrivateLinkResource_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the private link resources that need to be created for a service.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources", ApiVersion = "2021-11-01")] - public partial class GetAzHealthcarePrivateLinkResource_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener - { - /// 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(); - - /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// SendAsync Pipeline Steps to be appended to the front of 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// The instance of the that the remote call will use. - /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// Backing field for property. - private string _resourceGroupName; - - /// The name of the resource group that contains the service instance. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group that contains the service instance.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] - public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - - /// Backing field for property. - private string _resourceName; - - /// The name of the service instance. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the service instance.")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the service instance.", - SerializedName = @"resourceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] - public string ResourceName { get => this._resourceName; set => this._resourceName = value; } - - /// Backing field for property. - private string[] _subscriptionId; - - /// The subscription identifier. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The subscription identifier.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IErrorDetails - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IPrivateLinkResourceListResultDescription - /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); - if (telemetryInfo != null) - { - telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); - telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); - telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (showSecretsWarning == "true") - { - if (string.IsNullOrEmpty(sanitizedProperties)) - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - else - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - } - } - } - - /// - /// Intializes a new instance of the cmdlet class. - /// - public GetAzHealthcarePrivateLinkResource_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.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Information: - { - var data = messageData(); - WriteInformation(data.Message, new string[]{}); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 ; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - foreach( var SubscriptionId in this.SubscriptionId ) - { - await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PrivateLinkResourcesListByService(SubscriptionId, ResourceGroupName, ResourceName, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,ResourceName=ResourceName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline, enumerateCollection); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails - /// from the remote call - /// - /// A that will be complete when handling of 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.HealthcareApis.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, ResourceName=ResourceName }) - { - 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, ResourceName=ResourceName }) - { - 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.HealthcareApis.Models.Api20211101.IPrivateLinkResourceListResultDescription - /// 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 - // response should be returning an array of some kind. +Pageable - // nested-array / value / - WriteObject((await response).Value, true); - } - } - } -} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateEndpointConnection_Get.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateEndpointConnection_Get.cs index 873c879ea123..48ef5bf88329 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateEndpointConnection_Get.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateEndpointConnection_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Gets the specified private endpoint connection associated with the workspace. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareWorkspacePrivateEndpointConnection_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the specified private endpoint connection associated with the workspace.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareWorkspacePrivateEndpointConnection_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzHealthcareWorkspacePrivateEndpointConnection_Get : 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; + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzHealthcareWorkspacePrivateEndpointConnection_Get : glo [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -79,7 +100,7 @@ public partial class GetAzHealthcareWorkspacePrivateEndpointConnection_Get : glo /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateEndpointConnectionName; @@ -139,7 +160,8 @@ public partial class GetAzHealthcareWorkspacePrivateEndpointConnection_Get : glo [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -162,24 +184,24 @@ public partial class GetAzHealthcareWorkspacePrivateEndpointConnection_Get : 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription /// 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,6 +224,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -223,7 +250,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareWorkspacePrivateEndpointConnection_Get() { @@ -274,8 +301,33 @@ public GetAzHealthcareWorkspacePrivateEndpointConnection_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -328,7 +380,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -349,7 +401,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName,PrivateEndpointConnectionName=PrivateEndpointConnectionName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName,PrivateEndpointConnectionName=PrivateEndpointConnectionName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -387,12 +439,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -409,15 +461,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.HealthcareApis.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, WorkspaceName=WorkspaceName, PrivateEndpointConnectionName=PrivateEndpointConnectionName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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, WorkspaceName=WorkspaceName, PrivateEndpointConnectionName=PrivateEndpointConnectionName }) + 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 } }); @@ -427,12 +479,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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription /// 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 ) { @@ -444,8 +496,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentity.cs index 8579848d864a..7e3e24efed8e 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Gets the specified private endpoint connection associated with the workspace. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the specified private endpoint connection associated with the workspace.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzHealthcareWorkspacePrivateEndpointConnection_GetViaIde /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzHealthcareWorkspacePrivateEndpointConnection_GetViaIde [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +108,7 @@ public partial class GetAzHealthcareWorkspacePrivateEndpointConnection_GetViaIde /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +131,24 @@ public partial class GetAzHealthcareWorkspacePrivateEndpointConnection_GetViaIde /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription /// 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,6 +171,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +197,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public GetAzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentity() @@ -223,8 +249,33 @@ public GetAzHealthcareWorkspacePrivateEndpointConnection_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -277,7 +328,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -319,7 +370,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -357,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -379,7 +430,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -397,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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription /// 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 ) { @@ -414,8 +465,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateEndpointConnection_Get.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentityWorkspace.cs similarity index 71% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateEndpointConnection_Get.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentityWorkspace.cs index a78f92329adb..9dee2094411b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateEndpointConnection_Get.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentityWorkspace.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Gets the specified private endpoint connection associated with the service. + /// Gets the specified private endpoint connection associated with the workspace. /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcarePrivateEndpointConnection_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the specified private endpoint connection associated with the service.")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentityWorkspace")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the specified private endpoint connection associated with the workspace.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2021-11-01")] - public partial class GetAzHealthcarePrivateEndpointConnection_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2021-11-01")] + public partial class GetAzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentityWorkspace : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzHealthcarePrivateEndpointConnection_Get : 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzHealthcarePrivateEndpointConnection_Get : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,8 +97,13 @@ public partial class GetAzHealthcarePrivateEndpointConnection_Get : global::Syst /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - /// Backing field for property. - private string _name; + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateEndpointConnectionName; /// The name of the private endpoint connection associated with the Azure resource [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private endpoint connection associated with the Azure resource")] @@ -87,14 +113,8 @@ public partial class GetAzHealthcarePrivateEndpointConnection_Get : global::Syst Description = @"The name of the private endpoint connection associated with the Azure resource", SerializedName = @"privateEndpointConnectionName", PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("PrivateEndpointConnectionName")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] - public string Name { get => this._name; set => this._name = value; } - - /// - /// The instance of the that the remote call will use. - /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public string PrivateEndpointConnectionName { get => this._privateEndpointConnectionName; set => this._privateEndpointConnectionName = 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")] @@ -112,75 +132,37 @@ public partial class GetAzHealthcarePrivateEndpointConnection_Get : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - /// Backing field for property. - private string _resourceGroupName; + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _workspaceInputObject; - /// The name of the resource group that contains the service instance. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group that contains the service instance.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] - public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - - /// Backing field for property. - private string _resourceName; - - /// The name of the service instance. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the service instance.")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the service instance.", - SerializedName = @"resourceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] - public string ResourceName { get => this._resourceName; set => this._resourceName = value; } - - /// Backing field for property. - private string[] _subscriptionId; - - /// The subscription identifier. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The subscription identifier.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] - public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity WorkspaceInputObject { get => this._workspaceInputObject; set => this._workspaceInputObject = 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription /// 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) @@ -203,6 +185,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -224,9 +211,10 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public GetAzHealthcarePrivateEndpointConnection_Get() + public GetAzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentityWorkspace() { } @@ -275,8 +263,33 @@ public GetAzHealthcarePrivateEndpointConnection_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -329,7 +342,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -341,16 +354,34 @@ protected override void ProcessRecord() // get the client instance try { - foreach( var SubscriptionId in this.SubscriptionId ) + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (WorkspaceInputObject?.Id != null) + { + this.WorkspaceInputObject.Id += $"/privateEndpointConnections/{(global::System.Uri.EscapeDataString(this.PrivateEndpointConnectionName.ToString()))}"; + await this.Client.WorkspacePrivateEndpointConnectionsGetViaIdentity(WorkspaceInputObject.Id, onOk, onDefault, this, Pipeline); + } + else { - await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PrivateEndpointConnectionsGet(SubscriptionId, ResourceGroupName, ResourceName, Name, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // try to call with PATH parameters from Input Object + if (null == WorkspaceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + await this.Client.WorkspacePrivateEndpointConnectionsGet(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, PrivateEndpointConnectionName, onOk, onDefault, this, Pipeline); } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,ResourceName=ResourceName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { PrivateEndpointConnectionName=PrivateEndpointConnectionName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -388,12 +419,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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,15 +441,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.HealthcareApis.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, ResourceName=ResourceName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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, ResourceName=ResourceName, 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 } }); @@ -428,12 +459,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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription /// 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 ) { @@ -445,8 +476,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateEndpointConnection_List.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateEndpointConnection_List.cs index 95fd8d5ad66c..1428ac7889b5 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateEndpointConnection_List.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateEndpointConnection_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Lists all private endpoint connections for a workspace. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareWorkspacePrivateEndpointConnection_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Lists all private endpoint connections for a workspace.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareWorkspacePrivateEndpointConnection_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzHealthcareWorkspacePrivateEndpointConnection_List : 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzHealthcareWorkspacePrivateEndpointConnection_List : gl [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -79,7 +100,7 @@ public partial class GetAzHealthcareWorkspacePrivateEndpointConnection_List : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -125,7 +146,8 @@ public partial class GetAzHealthcareWorkspacePrivateEndpointConnection_List : gl [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -148,24 +170,24 @@ public partial class GetAzHealthcareWorkspacePrivateEndpointConnection_List : 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultDescription /// 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) @@ -188,6 +210,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -209,7 +236,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareWorkspacePrivateEndpointConnection_List() { @@ -260,8 +287,33 @@ public GetAzHealthcareWorkspacePrivateEndpointConnection_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -314,7 +366,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -373,12 +425,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -395,15 +447,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.HealthcareApis.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, WorkspaceName=WorkspaceName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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, WorkspaceName=WorkspaceName }) + 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 } }); @@ -413,12 +465,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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionListResultDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultDescription /// 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 ) { @@ -430,9 +482,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionListResultDescription + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / - WriteObject((await response).Value, true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateLinkResource_Get.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateLinkResource_Get.cs index b2fc428aa101..e4d5868063d9 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateLinkResource_Get.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateLinkResource_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Gets a private link resource that need to be created for a workspace. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareWorkspacePrivateLinkResource_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets a private link resource that need to be created for a workspace.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateLinkResources/{groupName}", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareWorkspacePrivateLinkResource_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzHealthcareWorkspacePrivateLinkResource_Get : 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzHealthcareWorkspacePrivateLinkResource_Get : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 _groupName; @@ -93,7 +114,7 @@ public partial class GetAzHealthcareWorkspacePrivateLinkResource_Get : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -139,7 +160,8 @@ public partial class GetAzHealthcareWorkspacePrivateLinkResource_Get : global::S [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -162,24 +184,24 @@ public partial class GetAzHealthcareWorkspacePrivateLinkResource_Get : 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription /// 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,6 +224,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -223,7 +250,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareWorkspacePrivateLinkResource_Get() { @@ -274,8 +301,33 @@ public GetAzHealthcareWorkspacePrivateLinkResource_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -328,7 +380,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -349,7 +401,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName,GroupName=GroupName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName,GroupName=GroupName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -387,12 +439,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -409,15 +461,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.HealthcareApis.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, WorkspaceName=WorkspaceName, GroupName=GroupName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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, WorkspaceName=WorkspaceName, GroupName=GroupName }) + 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 } }); @@ -427,12 +479,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.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription /// 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 ) { @@ -444,8 +496,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateLinkResource_GetViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateLinkResource_GetViaIdentity.cs index 5ec65b30b05c..a2457f16e8a5 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateLinkResource_GetViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateLinkResource_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Gets a private link resource that need to be created for a workspace. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareWorkspacePrivateLinkResource_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets a private link resource that need to be created for a workspace.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateLinkResources/{groupName}", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareWorkspacePrivateLinkResource_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzHealthcareWorkspacePrivateLinkResource_GetViaIdentity /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzHealthcareWorkspacePrivateLinkResource_GetViaIdentity [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +108,7 @@ public partial class GetAzHealthcareWorkspacePrivateLinkResource_GetViaIdentity /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +131,24 @@ public partial class GetAzHealthcareWorkspacePrivateLinkResource_GetViaIdentity /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription /// 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,6 +171,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +197,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareWorkspacePrivateLinkResource_GetViaIdentity() { @@ -222,8 +248,33 @@ public GetAzHealthcareWorkspacePrivateLinkResource_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -276,7 +327,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -318,7 +369,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -356,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -378,7 +429,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -396,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.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription /// 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 ) { @@ -413,8 +464,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateLinkResource_Get.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateLinkResource_GetViaIdentityWorkspace.cs similarity index 73% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateLinkResource_Get.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateLinkResource_GetViaIdentityWorkspace.cs index 3b4aa01ffcc2..c6288a4953e9 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcarePrivateLinkResource_Get.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateLinkResource_GetViaIdentityWorkspace.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Gets a private link resource that need to be created for a service. + /// Gets a private link resource that need to be created for a workspace. /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources/{groupName}" + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateLinkResources/{groupName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcarePrivateLinkResource_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets a private link resource that need to be created for a service.")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareWorkspacePrivateLinkResource_GetViaIdentityWorkspace")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets a private link resource that need to be created for a workspace.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources/{groupName}", ApiVersion = "2021-11-01")] - public partial class GetAzHealthcarePrivateLinkResource_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateLinkResources/{groupName}", ApiVersion = "2021-11-01")] + public partial class GetAzHealthcareWorkspacePrivateLinkResource_GetViaIdentityWorkspace : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzHealthcarePrivateLinkResource_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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzHealthcarePrivateLinkResource_Get : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 _groupName; @@ -93,7 +114,7 @@ public partial class GetAzHealthcarePrivateLinkResource_Get : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -111,75 +132,37 @@ public partial class GetAzHealthcarePrivateLinkResource_Get : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - /// Backing field for property. - private string _resourceGroupName; + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _workspaceInputObject; - /// The name of the resource group that contains the service instance. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group that contains the service instance.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] - public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - - /// Backing field for property. - private string _resourceName; - - /// The name of the service instance. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the service instance.")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the service instance.", - SerializedName = @"resourceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] - public string ResourceName { get => this._resourceName; set => this._resourceName = value; } - - /// Backing field for property. - private string[] _subscriptionId; - - /// The subscription identifier. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The subscription identifier.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] - public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity WorkspaceInputObject { get => this._workspaceInputObject; set => this._workspaceInputObject = 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription /// 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,6 +185,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -223,9 +211,10 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet + /// class. /// - public GetAzHealthcarePrivateLinkResource_Get() + public GetAzHealthcareWorkspacePrivateLinkResource_GetViaIdentityWorkspace() { } @@ -274,8 +263,33 @@ public GetAzHealthcarePrivateLinkResource_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -328,7 +342,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -340,16 +354,34 @@ protected override void ProcessRecord() // get the client instance try { - foreach( var SubscriptionId in this.SubscriptionId ) + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (WorkspaceInputObject?.Id != null) { - await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PrivateLinkResourcesGet(SubscriptionId, ResourceGroupName, ResourceName, GroupName, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + this.WorkspaceInputObject.Id += $"/privateLinkResources/{(global::System.Uri.EscapeDataString(this.GroupName.ToString()))}"; + await this.Client.WorkspacePrivateLinkResourcesGetViaIdentity(WorkspaceInputObject.Id, onOk, onDefault, this, Pipeline); } + else + { + // try to call with PATH parameters from Input Object + if (null == WorkspaceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + await this.Client.WorkspacePrivateLinkResourcesGet(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, GroupName, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,ResourceName=ResourceName,GroupName=GroupName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupName=GroupName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -387,12 +419,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -409,15 +441,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.HealthcareApis.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, ResourceName=ResourceName, GroupName=GroupName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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, ResourceName=ResourceName, GroupName=GroupName }) + 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 } }); @@ -427,12 +459,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.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription /// 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 ) { @@ -444,8 +476,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateLinkResource_List.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateLinkResource_List.cs index 284ddb0d32d9..d68e9a7e5381 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateLinkResource_List.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/GetAzHealthcareWorkspacePrivateLinkResource_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Gets the private link resources that need to be created for a workspace. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzHealthcareWorkspacePrivateLinkResource_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Gets the private link resources that need to be created for a workspace.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateLinkResources", ApiVersion = "2021-11-01")] public partial class GetAzHealthcareWorkspacePrivateLinkResource_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzHealthcareWorkspacePrivateLinkResource_List : 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzHealthcareWorkspacePrivateLinkResource_List : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -79,7 +100,7 @@ public partial class GetAzHealthcareWorkspacePrivateLinkResource_List : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -125,7 +146,8 @@ public partial class GetAzHealthcareWorkspacePrivateLinkResource_List : global:: [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -148,24 +170,24 @@ public partial class GetAzHealthcareWorkspacePrivateLinkResource_List : 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IPrivateLinkResourceListResultDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceListResultDescription /// 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) @@ -188,6 +210,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -209,7 +236,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzHealthcareWorkspacePrivateLinkResource_List() { @@ -260,8 +287,33 @@ public GetAzHealthcareWorkspacePrivateLinkResource_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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -314,7 +366,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -373,12 +425,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -395,15 +447,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.HealthcareApis.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, WorkspaceName=WorkspaceName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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, WorkspaceName=WorkspaceName }) + 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 } }); @@ -413,12 +465,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.HealthcareApis.Models.Api20211101.IPrivateLinkResourceListResultDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceListResultDescription /// 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 ) { @@ -430,9 +482,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceListResultDescription + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / - WriteObject((await response).Value, true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisService_CreateExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisService_CreateExpanded.cs index 877c4883c3ca..1d234cf99db7 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisService_CreateExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisService_CreateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Create or update the metadata of a service instance. + /// create the metadata of a service instance. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareApisService_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Create or update the metadata of a service instance.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create the metadata of a service instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", ApiVersion = "2021-11-01")] public partial class NewAzHealthcareApisService_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +38,11 @@ public partial class NewAzHealthcareApisService_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(); + /// The description of the service. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription _serviceDescriptionBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesDescription(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription _serviceDescriptionBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesDescription(); /// The access policies of the service instance. [global::System.Management.Automation.AllowEmptyCollection] @@ -47,8 +53,8 @@ public partial class NewAzHealthcareApisService_CreateExpanded : global::System. ReadOnly = false, Description = @"The access policies of the service instance.", SerializedName = @"accessPolicies", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry[] AccessPolicyObjectId { get => _serviceDescriptionBody.AccessPolicy ?? null /* arrayOf */; set => _serviceDescriptionBody.AccessPolicy = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntry) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntry[] AccessPolicyObjectId { get => _serviceDescriptionBody.AccessPolicy?.ToArray() ?? null /* fixedArrayOf */; set => _serviceDescriptionBody.AccessPolicy = (value != null ? new System.Collections.Generic.List(value) : null); } /// The list of the ACR login servers. [global::System.Management.Automation.AllowEmptyCollection] @@ -60,7 +66,7 @@ public partial class NewAzHealthcareApisService_CreateExpanded : global::System. Description = @"The list of the ACR login servers.", SerializedName = @"loginServers", PossibleTypes = new [] { typeof(string) })] - public string[] AcrConfigurationLoginServer { get => _serviceDescriptionBody.AcrConfigurationLoginServer ?? null /* arrayOf */; set => _serviceDescriptionBody.AcrConfigurationLoginServer = value; } + public string[] AcrConfigurationLoginServer { get => _serviceDescriptionBody.AcrConfigurationLoginServer?.ToArray() ?? null /* fixedArrayOf */; set => _serviceDescriptionBody.AcrConfigurationLoginServer = (value != null ? new System.Collections.Generic.List(value) : null); } /// The list of Open Container Initiative (OCI) artifacts. [global::System.Management.Automation.AllowEmptyCollection] @@ -71,8 +77,8 @@ public partial class NewAzHealthcareApisService_CreateExpanded : global::System. ReadOnly = false, Description = @"The list of Open Container Initiative (OCI) artifacts.", SerializedName = @"ociArtifacts", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get => _serviceDescriptionBody.AcrConfigurationOciArtifact ?? null /* arrayOf */; set => _serviceDescriptionBody.AcrConfigurationOciArtifact = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get => _serviceDescriptionBody.AcrConfigurationOciArtifact?.ToArray() ?? null /* fixedArrayOf */; set => _serviceDescriptionBody.AcrConfigurationOciArtifact = (value != null ? new System.Collections.Generic.List(value) : null); } /// If credentials are allowed via CORS. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If credentials are allowed via CORS.")] @@ -117,6 +123,9 @@ public partial class NewAzHealthcareApisService_CreateExpanded : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -130,7 +139,7 @@ public partial class NewAzHealthcareApisService_CreateExpanded : global::System. Description = @"The headers to be allowed via CORS.", SerializedName = @"headers", PossibleTypes = new [] { typeof(string) })] - public string[] CorsHeader { get => _serviceDescriptionBody.CorConfigurationHeader ?? null /* arrayOf */; set => _serviceDescriptionBody.CorConfigurationHeader = value; } + public string[] CorsHeader { get => _serviceDescriptionBody.CorConfigurationHeader?.ToArray() ?? null /* fixedArrayOf */; set => _serviceDescriptionBody.CorConfigurationHeader = (value != null ? new System.Collections.Generic.List(value) : null); } /// The max age to be allowed via CORS. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The max age to be allowed via CORS.")] @@ -153,7 +162,7 @@ public partial class NewAzHealthcareApisService_CreateExpanded : global::System. Description = @"The methods to be allowed via CORS.", SerializedName = @"methods", PossibleTypes = new [] { typeof(string) })] - public string[] CorsMethod { get => _serviceDescriptionBody.CorConfigurationMethod ?? null /* arrayOf */; set => _serviceDescriptionBody.CorConfigurationMethod = value; } + public string[] CorsMethod { get => _serviceDescriptionBody.CorConfigurationMethod?.ToArray() ?? null /* fixedArrayOf */; set => _serviceDescriptionBody.CorConfigurationMethod = (value != null ? new System.Collections.Generic.List(value) : null); } /// The origins to be allowed via CORS. [global::System.Management.Automation.AllowEmptyCollection] @@ -165,7 +174,7 @@ public partial class NewAzHealthcareApisService_CreateExpanded : global::System. Description = @"The origins to be allowed via CORS.", SerializedName = @"origins", PossibleTypes = new [] { typeof(string) })] - public string[] CorsOrigin { get => _serviceDescriptionBody.CorConfigurationOrigin ?? null /* arrayOf */; set => _serviceDescriptionBody.CorConfigurationOrigin = value; } + public string[] CorsOrigin { get => _serviceDescriptionBody.CorConfigurationOrigin?.ToArray() ?? null /* fixedArrayOf */; set => _serviceDescriptionBody.CorConfigurationOrigin = (value != null ? new System.Collections.Generic.List(value) : null); } /// The URI of the customer-managed key for the backing database. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The URI of the customer-managed key for the backing database.")] @@ -210,6 +219,10 @@ public partial class NewAzHealthcareApisService_CreateExpanded : global::System. PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter EnableSmartProxy { get => _serviceDescriptionBody.AuthenticationConfigurationSmartProxyEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _serviceDescriptionBody.AuthenticationConfigurationSmartProxyEnabled = value; } + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public global::System.Management.Automation.SwitchParameter EnableSystemAssignedIdentity { set => _serviceDescriptionBody.IdentityType = value.IsPresent ? "SystemAssigned": null ; } + /// /// An etag associated with the resource, used for optimistic concurrency when editing it. /// @@ -234,6 +247,9 @@ public partial class NewAzHealthcareApisService_CreateExpanded : global::System. PossibleTypes = new [] { typeof(string) })] public string ExportStorageAccountName { get => _serviceDescriptionBody.ExportConfigurationStorageAccountName ?? null; set => _serviceDescriptionBody.ExportConfigurationStorageAccountName = 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] @@ -246,20 +262,6 @@ public partial class NewAzHealthcareApisService_CreateExpanded : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// - /// Type of identity being specified, currently SystemAssigned and None are allowed. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of identity being specified, currently SystemAssigned and None are allowed.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Type of identity being specified, currently SystemAssigned and None are allowed.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType IdentityType { get => _serviceDescriptionBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType)""); set => _serviceDescriptionBody.IdentityType = value; } - /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -271,9 +273,9 @@ public partial class NewAzHealthcareApisService_CreateExpanded : global::System. ReadOnly = false, Description = @"The kind of the service.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind Kind { get => _serviceDescriptionBody.Kind; set => _serviceDescriptionBody.Kind = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir", "fhir-Stu3", "fhir-R4")] + public string Kind { get => _serviceDescriptionBody.Kind ?? null; set => _serviceDescriptionBody.Kind = value; } /// The resource location. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource location.")] @@ -319,7 +321,7 @@ public partial class NewAzHealthcareApisService_CreateExpanded : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } /// The list of private endpoint connections that are set up for this resource. [global::System.Management.Automation.AllowEmptyCollection] @@ -330,8 +332,8 @@ public partial class NewAzHealthcareApisService_CreateExpanded : global::System. ReadOnly = false, Description = @"The list of private endpoint connections that are set up for this resource.", SerializedName = @"privateEndpointConnections", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[] PrivateEndpointConnection { get => _serviceDescriptionBody.PrivateEndpointConnection ?? null /* arrayOf */; set => _serviceDescriptionBody.PrivateEndpointConnection = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection[] PrivateEndpointConnection { get => _serviceDescriptionBody.PrivateEndpointConnection?.ToArray() ?? null /* fixedArrayOf */; set => _serviceDescriptionBody.PrivateEndpointConnection = (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")] @@ -359,9 +361,9 @@ public partial class NewAzHealthcareApisService_CreateExpanded : global::System. ReadOnly = false, Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess PublicNetworkAccess { get => _serviceDescriptionBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess)""); set => _serviceDescriptionBody.PublicNetworkAccess = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccess { get => _serviceDescriptionBody.PublicNetworkAccess ?? null; set => _serviceDescriptionBody.PublicNetworkAccess = value; } /// Backing field for property. private string _resourceGroupName; @@ -391,7 +393,8 @@ public partial class NewAzHealthcareApisService_CreateExpanded : global::System. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -404,32 +407,32 @@ public partial class NewAzHealthcareApisService_CreateExpanded : global::System. ReadOnly = false, Description = @"The resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags Tag { get => _serviceDescriptionBody.Tag ?? null /* object */; set => _serviceDescriptionBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags Tag { get => _serviceDescriptionBody.Tag ?? null /* object */; set => _serviceDescriptionBody.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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IServicesDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription /// 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) @@ -540,11 +543,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -556,10 +584,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -569,7 +613,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzHealthcareApisService_CreateExpanded() { @@ -635,7 +679,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -648,12 +692,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ServicesCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _serviceDescriptionBody, onOk, onDefault, this, Pipeline); + await this.Client.ServicesCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _serviceDescriptionBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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=_serviceDescriptionBody}) + 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 } }); @@ -691,12 +735,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -713,15 +757,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.HealthcareApis.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=_serviceDescriptionBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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=_serviceDescriptionBody }) + 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 } }); @@ -731,12 +775,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.HealthcareApis.Models.Api20211101.IServicesDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription /// 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 ) { @@ -748,8 +792,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisService_CreateViaJsonFilePath.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisService_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..8a67550cab18 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisService_CreateViaJsonFilePath.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.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// create the metadata of a service instance. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareApisService_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create the metadata of a service instance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", ApiVersion = "2021-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class NewAzHealthcareApisService_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + public global::System.String _jsonString; + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the service instance.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group that contains the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group that contains the service instance.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IServicesDescription + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzHealthcareApisService_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareApisService_CreateViaJsonFilePath Clone() + { + var clone = new NewAzHealthcareApisService_CreateViaJsonFilePath(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 NewAzHealthcareApisService_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IServicesDescription + /// 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.HealthcareApis.Models.IServicesDescription + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcarePrivateEndpointConnection_Delete.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisService_CreateViaJsonString.cs similarity index 79% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcarePrivateEndpointConnection_Delete.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisService_CreateViaJsonString.cs index f1e8320e6f2b..0c568da0983c 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcarePrivateEndpointConnection_Delete.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisService_CreateViaJsonString.cs @@ -6,20 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Deletes a private endpoint connection. + /// create the metadata of a service instance. /// - /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzHealthcarePrivateEndpointConnection_Delete", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Deletes a private endpoint connection.")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareApisService_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create the metadata of a service instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2021-11-01")] - public partial class RemoveAzHealthcarePrivateEndpointConnection_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", ApiVersion = "2021-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class NewAzHealthcareApisService_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,6 +39,9 @@ public partial class RemoveAzHealthcarePrivateEndpointConnection_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(); + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] @@ -45,6 +52,9 @@ public partial class RemoveAzHealthcarePrivateEndpointConnection_Delete : global [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -58,6 +68,9 @@ public partial class RemoveAzHealthcarePrivateEndpointConnection_Delete : global [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -73,6 +86,19 @@ public partial class RemoveAzHealthcarePrivateEndpointConnection_Delete : global /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -84,15 +110,14 @@ public partial class RemoveAzHealthcarePrivateEndpointConnection_Delete : global /// Backing field for property. private string _name; - /// The name of the private endpoint connection associated with the Azure resource - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private endpoint connection associated with the Azure resource")] + /// The name of the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the service instance.")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = true, ReadOnly = false, - Description = @"The name of the private endpoint connection associated with the Azure resource", - SerializedName = @"privateEndpointConnectionName", + Description = @"The name of the service instance.", + SerializedName = @"resourceName", PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("PrivateEndpointConnectionName")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string Name { get => this._name; set => this._name = value; } @@ -104,17 +129,10 @@ public partial class RemoveAzHealthcarePrivateEndpointConnection_Delete : global [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter PassThru { get; set; } - /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -146,20 +164,6 @@ public partial class RemoveAzHealthcarePrivateEndpointConnection_Delete : global [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - /// Backing field for property. - private string _resourceName; - - /// The name of the service instance. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the service instance.")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the service instance.", - SerializedName = @"resourceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] - public string ResourceName { get => this._resourceName; set => this._resourceName = value; } - /// Backing field for property. private string _subscriptionId; @@ -174,7 +178,8 @@ public partial class RemoveAzHealthcarePrivateEndpointConnection_Delete : global [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -183,32 +188,24 @@ public partial class RemoveAzHealthcarePrivateEndpointConnection_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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); + 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.HealthcareApis.Models.IServicesDescription + /// 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, 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) @@ -229,10 +226,10 @@ protected override void BeginProcessing() } /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of RemoveAzHealthcarePrivateEndpointConnection_Delete - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.RemoveAzHealthcarePrivateEndpointConnection_Delete Clone() + /// a duplicate instance of NewAzHealthcareApisService_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareApisService_CreateViaJsonString Clone() { - var clone = new RemoveAzHealthcarePrivateEndpointConnection_Delete(); + var clone = new NewAzHealthcareApisService_CreateViaJsonString(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; @@ -247,8 +244,8 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.RemoveAzHealthc clone.HttpPipelineAppend = this.HttpPipelineAppend; clone.SubscriptionId = this.SubscriptionId; clone.ResourceGroupName = this.ResourceGroupName; - clone.ResourceName = this.ResourceName; clone.Name = this.Name; + clone.JsonString = this.JsonString; return clone; } @@ -319,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -335,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -347,6 +385,14 @@ protected override void EndProcessing() } } + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzHealthcareApisService_CreateViaJsonString() + { + + } + /// Performs execution of the command. protected override void ProcessRecord() { @@ -355,7 +401,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'PrivateEndpointConnectionsDelete' operation")) + if (ShouldProcess($"Call remote 'ServicesCreateOrUpdate' operation")) { if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { @@ -406,7 +452,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -419,12 +465,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PrivateEndpointConnectionsDelete(SubscriptionId, ResourceGroupName, ResourceName, Name, onOk, onNoContent, onDefault, this, Pipeline); + await this.Client.ServicesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,ResourceName=ResourceName,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 } }); @@ -436,14 +482,6 @@ protected override void ProcessRecord() } } - /// - /// Intializes a new instance of the cmdlet class. - /// - public RemoveAzHealthcarePrivateEndpointConnection_Delete() - { - - } - /// Interrupts currently running code within the command. protected override void StopProcessing() { @@ -470,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -492,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.HealthcareApis.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, ResourceName=ResourceName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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, ResourceName=ResourceName, 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 } }); @@ -508,51 +546,28 @@ protected override void StopProcessing() } } - /// 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. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription + /// 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) + 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, ref _returnNow); + overrideOnOk(responseMessage, response, 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); - } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisWorkspace_CreateExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisWorkspace_CreateExpanded.cs index 02362241f0d4..ddf4b6c4741e 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisWorkspace_CreateExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisWorkspace_CreateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Creates or updates a workspace resource with the specified parameters. + /// create a workspace resource with the specified parameters. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareApisWorkspace_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Creates or updates a workspace resource with the specified parameters.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create a workspace resource with the specified parameters.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}", ApiVersion = "2021-11-01")] public partial class NewAzHealthcareApisWorkspace_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +38,11 @@ public partial class NewAzHealthcareApisWorkspace_CreateExpanded : 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(); + /// Workspace resource. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace _workspaceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.Workspace(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace _workspaceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Workspace(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -48,6 +54,9 @@ public partial class NewAzHealthcareApisWorkspace_CreateExpanded : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -74,6 +83,9 @@ public partial class NewAzHealthcareApisWorkspace_CreateExpanded : global::Syste PossibleTypes = new [] { typeof(string) })] public string Etag { get => _workspaceBody.Etag ?? null; set => _workspaceBody.Etag = 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] @@ -134,7 +146,7 @@ public partial class NewAzHealthcareApisWorkspace_CreateExpanded : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,9 +174,9 @@ public partial class NewAzHealthcareApisWorkspace_CreateExpanded : global::Syste ReadOnly = false, Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess PublicNetworkAccess { get => _workspaceBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess)""); set => _workspaceBody.PublicNetworkAccess = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccess { get => _workspaceBody.PublicNetworkAccess ?? null; set => _workspaceBody.PublicNetworkAccess = value; } /// Backing field for property. private string _resourceGroupName; @@ -194,7 +206,8 @@ public partial class NewAzHealthcareApisWorkspace_CreateExpanded : global::Syste [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -207,32 +220,32 @@ public partial class NewAzHealthcareApisWorkspace_CreateExpanded : global::Syste ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => _workspaceBody.Tag ?? null /* object */; set => _workspaceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => _workspaceBody.Tag ?? null /* object */; set => _workspaceBody.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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IWorkspace + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace /// 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) @@ -270,8 +283,8 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcare clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; clone._workspaceBody = this._workspaceBody; - clone.ResourceGroupName = this.ResourceGroupName; clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; clone.Name = this.Name; return clone; } @@ -343,11 +356,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -359,10 +397,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -372,7 +426,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzHealthcareApisWorkspace_CreateExpanded() { @@ -438,7 +492,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -451,12 +505,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WorkspacesCreateOrUpdate(ResourceGroupName, SubscriptionId, Name, _workspaceBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkspacesCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _workspaceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,body=_workspaceBody}) + 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 } }); @@ -494,12 +548,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 +570,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.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_workspaceBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_workspaceBody }) + 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 +588,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.HealthcareApis.Models.Api20211101.IWorkspace + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace /// 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 +605,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisWorkspace_CreateViaJsonFilePath.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisWorkspace_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..f06d0be35724 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisWorkspace_CreateViaJsonFilePath.cs @@ -0,0 +1,577 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// create a workspace resource with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareApisWorkspace_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create a workspace resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}", ApiVersion = "2021-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class NewAzHealthcareApisWorkspace_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + public global::System.String _jsonString; + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("WorkspaceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group that contains the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group that contains the service instance.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IWorkspace + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzHealthcareApisWorkspace_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareApisWorkspace_CreateViaJsonFilePath Clone() + { + var clone = new NewAzHealthcareApisWorkspace_CreateViaJsonFilePath(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 NewAzHealthcareApisWorkspace_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkspacesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.WorkspacesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IWorkspace + /// 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.HealthcareApis.Models.IWorkspace + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisWorkspace_CreateViaJsonString.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisWorkspace_CreateViaJsonString.cs new file mode 100644 index 000000000000..8017db405fd2 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareApisWorkspace_CreateViaJsonString.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.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// create a workspace resource with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareApisWorkspace_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create a workspace resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}", ApiVersion = "2021-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class NewAzHealthcareApisWorkspace_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("WorkspaceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group that contains the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group that contains the service instance.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IWorkspace + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzHealthcareApisWorkspace_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareApisWorkspace_CreateViaJsonString Clone() + { + var clone = new NewAzHealthcareApisWorkspace_CreateViaJsonString(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 NewAzHealthcareApisWorkspace_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkspacesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.WorkspacesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IWorkspace + /// 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.HealthcareApis.Models.IWorkspace + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareDicomService_CreateExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareDicomService_CreateExpanded.cs index 484a8de8d716..3d5e31674884 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareDicomService_CreateExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareDicomService_CreateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Creates or updates a DICOM Service resource with the specified parameters. + /// create a DICOM Service resource with the specified parameters. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareDicomService_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Creates or updates a DICOM Service resource with the specified parameters.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create a DICOM Service resource with the specified parameters.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", ApiVersion = "2021-11-01")] public partial class NewAzHealthcareDicomService_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,7 +39,10 @@ public partial class NewAzHealthcareDicomService_CreateExpanded : global::System private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); /// The description of Dicom Service - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService _dicomserviceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomService(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService _dicomserviceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomService(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -48,6 +54,9 @@ public partial class NewAzHealthcareDicomService_CreateExpanded : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -61,6 +70,10 @@ public partial class NewAzHealthcareDicomService_CreateExpanded : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public global::System.Management.Automation.SwitchParameter EnableSystemAssignedIdentity { set => _dicomserviceBody.IdentityType = value.IsPresent ? "SystemAssigned": null ; } + /// /// An etag associated with the resource, used for optimistic concurrency when editing it. /// @@ -74,6 +87,9 @@ public partial class NewAzHealthcareDicomService_CreateExpanded : global::System PossibleTypes = new [] { typeof(string) })] public string Etag { get => _dicomserviceBody.Etag ?? null; set => _dicomserviceBody.Etag = 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] @@ -86,36 +102,6 @@ public partial class NewAzHealthcareDicomService_CreateExpanded : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// - /// Type of identity being specified, currently SystemAssigned and None are allowed. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of identity being specified, currently SystemAssigned and None are allowed.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Type of identity being specified, currently SystemAssigned and None are allowed.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType IdentityType { get => _dicomserviceBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType)""); set => _dicomserviceBody.IdentityType = value; } - - /// - /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM - /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - /// The dictionary values can be empty objects ({}) in requests. - /// - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", - SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _dicomserviceBody.IdentityUserAssignedIdentity ?? null /* object */; set => _dicomserviceBody.IdentityUserAssignedIdentity = value; } - /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -164,7 +150,7 @@ public partial class NewAzHealthcareDicomService_CreateExpanded : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,9 +178,9 @@ public partial class NewAzHealthcareDicomService_CreateExpanded : global::System ReadOnly = false, Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess PublicNetworkAccess { get => _dicomserviceBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess)""); set => _dicomserviceBody.PublicNetworkAccess = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccess { get => _dicomserviceBody.PublicNetworkAccess ?? null; set => _dicomserviceBody.PublicNetworkAccess = value; } /// Backing field for property. private string _resourceGroupName; @@ -224,7 +210,8 @@ public partial class NewAzHealthcareDicomService_CreateExpanded : global::System [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -237,8 +224,16 @@ public partial class NewAzHealthcareDicomService_CreateExpanded : global::System ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => _dicomserviceBody.Tag ?? null /* object */; set => _dicomserviceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => _dicomserviceBody.Tag ?? null /* object */; set => _dicomserviceBody.Tag = value; } + + /// + /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in + /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] + [global::System.Management.Automation.AllowEmptyCollection] + public string[] UserAssignedIdentity { get; set; } /// Backing field for property. private string _workspaceName; @@ -259,24 +254,24 @@ public partial class NewAzHealthcareDicomService_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IDicomService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService /// 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) @@ -314,8 +309,8 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcare clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; clone._dicomserviceBody = this._dicomserviceBody; - clone.ResourceGroupName = this.ResourceGroupName; clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; clone.WorkspaceName = this.WorkspaceName; clone.Name = this.Name; return clone; @@ -388,11 +383,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -404,10 +424,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -417,13 +453,38 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzHealthcareDicomService_CreateExpanded() { } + private void PreProcessManagedIdentityParameters() + { + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _dicomserviceBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _dicomserviceBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentity()); + } + } + // calculate IdentityType + if (this.UserAssignedIdentity?.Length > 0) + { + if ("SystemAssigned".Equals(_dicomserviceBody.IdentityType, StringComparison.InvariantCultureIgnoreCase)) + { + _dicomserviceBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else + { + _dicomserviceBody.IdentityType = "UserAssigned"; + } + } + } + /// Performs execution of the command. protected override void ProcessRecord() { @@ -483,7 +544,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -496,12 +557,13 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.DicomServicesCreateOrUpdate(ResourceGroupName, SubscriptionId, WorkspaceName, Name, _dicomserviceBody, onOk, onDefault, this, Pipeline); + this.PreProcessManagedIdentityParameters(); + await this.Client.DicomServicesCreateOrUpdate(SubscriptionId, ResourceGroupName, WorkspaceName, Name, _dicomserviceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,WorkspaceName=WorkspaceName,Name=Name,body=_dicomserviceBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -539,12 +601,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -561,15 +623,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.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName, Name=Name, body=_dicomserviceBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName, Name=Name, body=_dicomserviceBody }) + 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 } }); @@ -579,12 +641,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.HealthcareApis.Models.Api20211101.IDicomService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService /// 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 ) { @@ -596,8 +658,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareDicomService_CreateViaIdentityWorkspaceExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareDicomService_CreateViaIdentityWorkspaceExpanded.cs new file mode 100644 index 000000000000..90c11de52205 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareDicomService_CreateViaIdentityWorkspaceExpanded.cs @@ -0,0 +1,650 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// create a DICOM Service resource with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareDicomService_CreateViaIdentityWorkspaceExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create a DICOM Service resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", ApiVersion = "2021-11-01")] + public partial class NewAzHealthcareDicomService_CreateViaIdentityWorkspaceExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// The description of Dicom Service + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService _dicomserviceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomService(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public global::System.Management.Automation.SwitchParameter EnableSystemAssignedIdentity { set => _dicomserviceBody.IdentityType = value.IsPresent ? "SystemAssigned": null ; } + + /// + /// An etag associated with the resource, used for optimistic concurrency when editing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An etag associated with the resource, used for optimistic concurrency when editing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _dicomserviceBody.Etag ?? null; set => _dicomserviceBody.Etag = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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; } } + + /// The resource location. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _dicomserviceBody.Location ?? null; set => _dicomserviceBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of DICOM Service resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of DICOM Service resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of DICOM Service resource.", + SerializedName = @"dicomServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DicomServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Control permission for data plane traffic coming from public networks while private endpoint is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccess { get => _dicomserviceBody.PublicNetworkAccess ?? null; set => _dicomserviceBody.PublicNetworkAccess = value; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => _dicomserviceBody.Tag ?? null /* object */; set => _dicomserviceBody.Tag = value; } + + /// + /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in + /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] + [global::System.Management.Automation.AllowEmptyCollection] + public string[] UserAssignedIdentity { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _workspaceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity WorkspaceInputObject { get => this._workspaceInputObject; set => this._workspaceInputObject = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IDicomService + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzHealthcareDicomService_CreateViaIdentityWorkspaceExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareDicomService_CreateViaIdentityWorkspaceExpanded Clone() + { + var clone = new NewAzHealthcareDicomService_CreateViaIdentityWorkspaceExpanded(); + 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._dicomserviceBody = this._dicomserviceBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 NewAzHealthcareDicomService_CreateViaIdentityWorkspaceExpanded() + { + + } + + private void PreProcessManagedIdentityParameters() + { + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _dicomserviceBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _dicomserviceBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentity()); + } + } + // calculate IdentityType + if (this.UserAssignedIdentity?.Length > 0) + { + if ("SystemAssigned".Equals(_dicomserviceBody.IdentityType, StringComparison.InvariantCultureIgnoreCase)) + { + _dicomserviceBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else + { + _dicomserviceBody.IdentityType = "UserAssigned"; + } + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DicomServicesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (WorkspaceInputObject?.Id != null) + { + this.WorkspaceInputObject.Id += $"/dicomservices/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + this.PreProcessManagedIdentityParameters(); + await this.Client.DicomServicesCreateOrUpdateViaIdentity(WorkspaceInputObject.Id, _dicomserviceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == WorkspaceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + this.PreProcessManagedIdentityParameters(); + await this.Client.DicomServicesCreateOrUpdate(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, Name, _dicomserviceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IDicomService + /// 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.HealthcareApis.Models.IDicomService + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareDicomService_CreateViaJsonFilePath.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareDicomService_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..594ee521c19e --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareDicomService_CreateViaJsonFilePath.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.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// create a DICOM Service resource with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareDicomService_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create a DICOM Service resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", ApiVersion = "2021-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class NewAzHealthcareDicomService_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + public global::System.String _jsonString; + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of DICOM Service resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of DICOM Service resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of DICOM Service resource.", + SerializedName = @"dicomServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DicomServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group that contains the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group that contains the service instance.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _workspaceName; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string WorkspaceName { get => this._workspaceName; set => this._workspaceName = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IDicomService + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzHealthcareDicomService_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareDicomService_CreateViaJsonFilePath Clone() + { + var clone = new NewAzHealthcareDicomService_CreateViaJsonFilePath(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.WorkspaceName = this.WorkspaceName; + clone.Name = this.Name; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 NewAzHealthcareDicomService_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DicomServicesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DicomServicesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, WorkspaceName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IDicomService + /// 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.HealthcareApis.Models.IDicomService + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareDicomService_CreateViaJsonString.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareDicomService_CreateViaJsonString.cs new file mode 100644 index 000000000000..083563bd723d --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareDicomService_CreateViaJsonString.cs @@ -0,0 +1,590 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// create a DICOM Service resource with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareDicomService_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create a DICOM Service resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", ApiVersion = "2021-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class NewAzHealthcareDicomService_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of DICOM Service resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of DICOM Service resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of DICOM Service resource.", + SerializedName = @"dicomServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DicomServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group that contains the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group that contains the service instance.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _workspaceName; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string WorkspaceName { get => this._workspaceName; set => this._workspaceName = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IDicomService + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzHealthcareDicomService_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareDicomService_CreateViaJsonString Clone() + { + var clone = new NewAzHealthcareDicomService_CreateViaJsonString(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.WorkspaceName = this.WorkspaceName; + clone.Name = this.Name; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 NewAzHealthcareDicomService_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DicomServicesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DicomServicesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, WorkspaceName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IDicomService + /// 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.HealthcareApis.Models.IDicomService + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareFhirService_CreateExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareFhirService_CreateExpanded.cs index 0095a8b08458..f55d7abb8909 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareFhirService_CreateExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareFhirService_CreateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Creates or updates a FHIR Service resource with the specified parameters. + /// create a FHIR Service resource with the specified parameters. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareFhirService_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Creates or updates a FHIR Service resource with the specified parameters.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create a FHIR Service resource with the specified parameters.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", ApiVersion = "2021-11-01")] public partial class NewAzHealthcareFhirService_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +38,11 @@ public partial class NewAzHealthcareFhirService_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(); + /// The description of Fhir Service - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService _fhirserviceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirService(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService _fhirserviceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirService(); /// Fhir Service access policies. [global::System.Management.Automation.AllowEmptyCollection] @@ -47,8 +53,8 @@ public partial class NewAzHealthcareFhirService_CreateExpanded : global::System. ReadOnly = false, Description = @"Fhir Service access policies.", SerializedName = @"accessPolicies", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry[] AccessPolicyObjectId { get => _fhirserviceBody.AccessPolicy ?? null /* arrayOf */; set => _fhirserviceBody.AccessPolicy = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry[] AccessPolicyObjectId { get => _fhirserviceBody.AccessPolicy?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.AccessPolicy = (value != null ? new System.Collections.Generic.List(value) : null); } /// The list of the Azure container registry login servers. [global::System.Management.Automation.AllowEmptyCollection] @@ -60,7 +66,7 @@ public partial class NewAzHealthcareFhirService_CreateExpanded : global::System. Description = @"The list of the Azure container registry login servers.", SerializedName = @"loginServers", PossibleTypes = new [] { typeof(string) })] - public string[] AcrConfigurationLoginServer { get => _fhirserviceBody.AcrConfigurationLoginServer ?? null /* arrayOf */; set => _fhirserviceBody.AcrConfigurationLoginServer = value; } + public string[] AcrConfigurationLoginServer { get => _fhirserviceBody.AcrConfigurationLoginServer?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.AcrConfigurationLoginServer = (value != null ? new System.Collections.Generic.List(value) : null); } /// The list of Open Container Initiative (OCI) artifacts. [global::System.Management.Automation.AllowEmptyCollection] @@ -71,8 +77,8 @@ public partial class NewAzHealthcareFhirService_CreateExpanded : global::System. ReadOnly = false, Description = @"The list of Open Container Initiative (OCI) artifacts.", SerializedName = @"ociArtifacts", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get => _fhirserviceBody.AcrConfigurationOciArtifact ?? null /* arrayOf */; set => _fhirserviceBody.AcrConfigurationOciArtifact = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get => _fhirserviceBody.AcrConfigurationOciArtifact?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.AcrConfigurationOciArtifact = (value != null ? new System.Collections.Generic.List(value) : null); } /// If credentials are allowed via CORS. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If credentials are allowed via CORS.")] @@ -117,6 +123,9 @@ public partial class NewAzHealthcareFhirService_CreateExpanded : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -130,7 +139,7 @@ public partial class NewAzHealthcareFhirService_CreateExpanded : global::System. Description = @"The headers to be allowed via CORS.", SerializedName = @"headers", PossibleTypes = new [] { typeof(string) })] - public string[] CorsHeader { get => _fhirserviceBody.CorConfigurationHeader ?? null /* arrayOf */; set => _fhirserviceBody.CorConfigurationHeader = value; } + public string[] CorsHeader { get => _fhirserviceBody.CorConfigurationHeader?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.CorConfigurationHeader = (value != null ? new System.Collections.Generic.List(value) : null); } /// The max age to be allowed via CORS. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The max age to be allowed via CORS.")] @@ -153,7 +162,7 @@ public partial class NewAzHealthcareFhirService_CreateExpanded : global::System. Description = @"The methods to be allowed via CORS.", SerializedName = @"methods", PossibleTypes = new [] { typeof(string) })] - public string[] CorsMethod { get => _fhirserviceBody.CorConfigurationMethod ?? null /* arrayOf */; set => _fhirserviceBody.CorConfigurationMethod = value; } + public string[] CorsMethod { get => _fhirserviceBody.CorConfigurationMethod?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.CorConfigurationMethod = (value != null ? new System.Collections.Generic.List(value) : null); } /// The origins to be allowed via CORS. [global::System.Management.Automation.AllowEmptyCollection] @@ -165,7 +174,7 @@ public partial class NewAzHealthcareFhirService_CreateExpanded : global::System. Description = @"The origins to be allowed via CORS.", SerializedName = @"origins", PossibleTypes = new [] { typeof(string) })] - public string[] CorsOrigin { get => _fhirserviceBody.CorConfigurationOrigin ?? null /* arrayOf */; set => _fhirserviceBody.CorConfigurationOrigin = value; } + public string[] CorsOrigin { get => _fhirserviceBody.CorConfigurationOrigin?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.CorConfigurationOrigin = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -188,6 +197,10 @@ public partial class NewAzHealthcareFhirService_CreateExpanded : global::System. PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter EnableSmartProxy { get => _fhirserviceBody.AuthenticationConfigurationSmartProxyEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _fhirserviceBody.AuthenticationConfigurationSmartProxyEnabled = value; } + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public global::System.Management.Automation.SwitchParameter EnableSystemAssignedIdentity { set => _fhirserviceBody.IdentityType = value.IsPresent ? "SystemAssigned": null ; } + /// /// An etag associated with the resource, used for optimistic concurrency when editing it. /// @@ -212,6 +225,9 @@ public partial class NewAzHealthcareFhirService_CreateExpanded : global::System. PossibleTypes = new [] { typeof(string) })] public string ExportStorageAccountName { get => _fhirserviceBody.ExportConfigurationStorageAccountName ?? null; set => _fhirserviceBody.ExportConfigurationStorageAccountName = 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] @@ -224,36 +240,6 @@ public partial class NewAzHealthcareFhirService_CreateExpanded : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// - /// Type of identity being specified, currently SystemAssigned and None are allowed. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of identity being specified, currently SystemAssigned and None are allowed.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Type of identity being specified, currently SystemAssigned and None are allowed.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType IdentityType { get => _fhirserviceBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType)""); set => _fhirserviceBody.IdentityType = value; } - - /// - /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM - /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - /// The dictionary values can be empty objects ({}) in requests. - /// - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", - SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _fhirserviceBody.IdentityUserAssignedIdentity ?? null /* object */; set => _fhirserviceBody.IdentityUserAssignedIdentity = value; } - /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -265,9 +251,9 @@ public partial class NewAzHealthcareFhirService_CreateExpanded : global::System. ReadOnly = false, Description = @"The kind of the service.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind Kind { get => _fhirserviceBody.Kind ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind)""); set => _fhirserviceBody.Kind = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir-Stu3", "fhir-R4")] + public string Kind { get => _fhirserviceBody.Kind ?? null; set => _fhirserviceBody.Kind = value; } /// The resource location. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource location.")] @@ -314,7 +300,7 @@ public partial class NewAzHealthcareFhirService_CreateExpanded : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,9 +328,9 @@ public partial class NewAzHealthcareFhirService_CreateExpanded : global::System. ReadOnly = false, Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess PublicNetworkAccess { get => _fhirserviceBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess)""); set => _fhirserviceBody.PublicNetworkAccess = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccess { get => _fhirserviceBody.PublicNetworkAccess ?? null; set => _fhirserviceBody.PublicNetworkAccess = value; } /// Backing field for property. private string _resourceGroupName; @@ -368,9 +354,9 @@ public partial class NewAzHealthcareFhirService_CreateExpanded : global::System. ReadOnly = false, Description = @"The default value for tracking history across all resources.", SerializedName = @"default", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy ResourceVersionPolicyConfigurationDefault { get => _fhirserviceBody.ResourceVersionPolicyConfigurationDefault ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy)""); set => _fhirserviceBody.ResourceVersionPolicyConfigurationDefault = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("no-version", "versioned", "versioned-update")] + public string ResourceVersionPolicyConfigurationDefault { get => _fhirserviceBody.ResourceVersionPolicyConfigurationDefault ?? null; set => _fhirserviceBody.ResourceVersionPolicyConfigurationDefault = value; } /// A list of FHIR Resources and their version policy overrides. [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] @@ -381,8 +367,8 @@ public partial class NewAzHealthcareFhirService_CreateExpanded : global::System. ReadOnly = false, Description = @"A list of FHIR Resources and their version policy overrides.", SerializedName = @"resourceTypeOverrides", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceVersionPolicyConfigurationResourceTypeOverride { get => _fhirserviceBody.ResourceVersionPolicyConfigurationResourceTypeOverride ?? null /* object */; set => _fhirserviceBody.ResourceVersionPolicyConfigurationResourceTypeOverride = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceVersionPolicyConfigurationResourceTypeOverride { get => _fhirserviceBody.ResourceVersionPolicyConfigurationResourceTypeOverride ?? null /* object */; set => _fhirserviceBody.ResourceVersionPolicyConfigurationResourceTypeOverride = value; } /// Backing field for property. private string _subscriptionId; @@ -398,7 +384,8 @@ public partial class NewAzHealthcareFhirService_CreateExpanded : global::System. [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -411,8 +398,16 @@ public partial class NewAzHealthcareFhirService_CreateExpanded : global::System. ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => _fhirserviceBody.Tag ?? null /* object */; set => _fhirserviceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => _fhirserviceBody.Tag ?? null /* object */; set => _fhirserviceBody.Tag = value; } + + /// + /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in + /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] + [global::System.Management.Automation.AllowEmptyCollection] + public string[] UserAssignedIdentity { get; set; } /// Backing field for property. private string _workspaceName; @@ -433,24 +428,24 @@ public partial class NewAzHealthcareFhirService_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IFhirService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService /// 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) @@ -488,8 +483,8 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcare clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; clone._fhirserviceBody = this._fhirserviceBody; - clone.ResourceGroupName = this.ResourceGroupName; clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; clone.WorkspaceName = this.WorkspaceName; clone.Name = this.Name; return clone; @@ -562,11 +557,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -578,10 +598,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -591,13 +627,38 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzHealthcareFhirService_CreateExpanded() { } + private void PreProcessManagedIdentityParameters() + { + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _fhirserviceBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _fhirserviceBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentity()); + } + } + // calculate IdentityType + if (this.UserAssignedIdentity?.Length > 0) + { + if ("SystemAssigned".Equals(_fhirserviceBody.IdentityType, StringComparison.InvariantCultureIgnoreCase)) + { + _fhirserviceBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else + { + _fhirserviceBody.IdentityType = "UserAssigned"; + } + } + } + /// Performs execution of the command. protected override void ProcessRecord() { @@ -657,7 +718,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -670,12 +731,13 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.FhirServicesCreateOrUpdate(ResourceGroupName, SubscriptionId, WorkspaceName, Name, _fhirserviceBody, onOk, onDefault, this, Pipeline); + this.PreProcessManagedIdentityParameters(); + await this.Client.FhirServicesCreateOrUpdate(SubscriptionId, ResourceGroupName, WorkspaceName, Name, _fhirserviceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,WorkspaceName=WorkspaceName,Name=Name,body=_fhirserviceBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -713,12 +775,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -735,15 +797,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.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName, Name=Name, body=_fhirserviceBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName, Name=Name, body=_fhirserviceBody }) + 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 } }); @@ -753,12 +815,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.HealthcareApis.Models.Api20211101.IFhirService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService /// 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 ) { @@ -770,8 +832,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareFhirService_CreateViaIdentityWorkspaceExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareFhirService_CreateViaIdentityWorkspaceExpanded.cs new file mode 100644 index 000000000000..31de3c0154bb --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareFhirService_CreateViaIdentityWorkspaceExpanded.cs @@ -0,0 +1,824 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// create a FHIR Service resource with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareFhirService_CreateViaIdentityWorkspaceExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create a FHIR Service resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", ApiVersion = "2021-11-01")] + public partial class NewAzHealthcareFhirService_CreateViaIdentityWorkspaceExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// The description of Fhir Service + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService _fhirserviceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirService(); + + /// Fhir Service access policies. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Fhir Service access policies.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fhir Service access policies.", + SerializedName = @"accessPolicies", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry[] AccessPolicyObjectId { get => _fhirserviceBody.AccessPolicy?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.AccessPolicy = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The list of the Azure container registry login servers. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of the Azure container registry login servers.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of the Azure container registry login servers.", + SerializedName = @"loginServers", + PossibleTypes = new [] { typeof(string) })] + public string[] AcrConfigurationLoginServer { get => _fhirserviceBody.AcrConfigurationLoginServer?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.AcrConfigurationLoginServer = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The list of Open Container Initiative (OCI) artifacts. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of Open Container Initiative (OCI) artifacts.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of Open Container Initiative (OCI) artifacts.", + SerializedName = @"ociArtifacts", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get => _fhirserviceBody.AcrConfigurationOciArtifact?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.AcrConfigurationOciArtifact = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// If credentials are allowed via CORS. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If credentials are allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If credentials are allowed via CORS.", + SerializedName = @"allowCredentials", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowCorsCredential { get => _fhirserviceBody.CorConfigurationAllowCredentials ?? default(global::System.Management.Automation.SwitchParameter); set => _fhirserviceBody.CorConfigurationAllowCredentials = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// The audience url for the service + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The audience url for the service")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The audience url for the service", + SerializedName = @"audience", + PossibleTypes = new [] { typeof(string) })] + public string Audience { get => _fhirserviceBody.AuthenticationConfigurationAudience ?? null; set => _fhirserviceBody.AuthenticationConfigurationAudience = value; } + + /// The authority url for the service + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The authority url for the service")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The authority url for the service", + SerializedName = @"authority", + PossibleTypes = new [] { typeof(string) })] + public string Authority { get => _fhirserviceBody.AuthenticationConfigurationAuthority ?? null; set => _fhirserviceBody.AuthenticationConfigurationAuthority = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; + + /// The headers to be allowed via CORS. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The headers to be allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The headers to be allowed via CORS.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(string) })] + public string[] CorsHeader { get => _fhirserviceBody.CorConfigurationHeader?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.CorConfigurationHeader = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The max age to be allowed via CORS. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The max age to be allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The max age to be allowed via CORS.", + SerializedName = @"maxAge", + PossibleTypes = new [] { typeof(int) })] + public int CorsMaxAge { get => _fhirserviceBody.CorConfigurationMaxAge ?? default(int); set => _fhirserviceBody.CorConfigurationMaxAge = value; } + + /// The methods to be allowed via CORS. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The methods to be allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The methods to be allowed via CORS.", + SerializedName = @"methods", + PossibleTypes = new [] { typeof(string) })] + public string[] CorsMethod { get => _fhirserviceBody.CorConfigurationMethod?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.CorConfigurationMethod = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The origins to be allowed via CORS. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The origins to be allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The origins to be allowed via CORS.", + SerializedName = @"origins", + PossibleTypes = new [] { typeof(string) })] + public string[] CorsOrigin { get => _fhirserviceBody.CorConfigurationOrigin?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.CorConfigurationOrigin = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// If the SMART on FHIR proxy is enabled + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If the SMART on FHIR proxy is enabled")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If the SMART on FHIR proxy is enabled", + SerializedName = @"smartProxyEnabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableSmartProxy { get => _fhirserviceBody.AuthenticationConfigurationSmartProxyEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _fhirserviceBody.AuthenticationConfigurationSmartProxyEnabled = value; } + + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public global::System.Management.Automation.SwitchParameter EnableSystemAssignedIdentity { set => _fhirserviceBody.IdentityType = value.IsPresent ? "SystemAssigned": null ; } + + /// + /// An etag associated with the resource, used for optimistic concurrency when editing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An etag associated with the resource, used for optimistic concurrency when editing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _fhirserviceBody.Etag ?? null; set => _fhirserviceBody.Etag = value; } + + /// The name of the default export storage account. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the default export storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the default export storage account.", + SerializedName = @"storageAccountName", + PossibleTypes = new [] { typeof(string) })] + public string ExportStorageAccountName { get => _fhirserviceBody.ExportConfigurationStorageAccountName ?? null; set => _fhirserviceBody.ExportConfigurationStorageAccountName = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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; } } + + /// The kind of the service. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The kind of the service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The kind of the service.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir-Stu3", "fhir-R4")] + public string Kind { get => _fhirserviceBody.Kind ?? null; set => _fhirserviceBody.Kind = value; } + + /// The resource location. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _fhirserviceBody.Location ?? null; set => _fhirserviceBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of FHIR Service resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of FHIR Service resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of FHIR Service resource.", + SerializedName = @"fhirServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("FhirServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Control permission for data plane traffic coming from public networks while private endpoint is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccess { get => _fhirserviceBody.PublicNetworkAccess ?? null; set => _fhirserviceBody.PublicNetworkAccess = value; } + + /// The default value for tracking history across all resources. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default value for tracking history across all resources.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value for tracking history across all resources.", + SerializedName = @"default", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("no-version", "versioned", "versioned-update")] + public string ResourceVersionPolicyConfigurationDefault { get => _fhirserviceBody.ResourceVersionPolicyConfigurationDefault ?? null; set => _fhirserviceBody.ResourceVersionPolicyConfigurationDefault = value; } + + /// A list of FHIR Resources and their version policy overrides. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A list of FHIR Resources and their version policy overrides.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of FHIR Resources and their version policy overrides.", + SerializedName = @"resourceTypeOverrides", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceVersionPolicyConfigurationResourceTypeOverride { get => _fhirserviceBody.ResourceVersionPolicyConfigurationResourceTypeOverride ?? null /* object */; set => _fhirserviceBody.ResourceVersionPolicyConfigurationResourceTypeOverride = value; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => _fhirserviceBody.Tag ?? null /* object */; set => _fhirserviceBody.Tag = value; } + + /// + /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in + /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] + [global::System.Management.Automation.AllowEmptyCollection] + public string[] UserAssignedIdentity { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _workspaceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity WorkspaceInputObject { get => this._workspaceInputObject; set => this._workspaceInputObject = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IFhirService + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzHealthcareFhirService_CreateViaIdentityWorkspaceExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareFhirService_CreateViaIdentityWorkspaceExpanded Clone() + { + var clone = new NewAzHealthcareFhirService_CreateViaIdentityWorkspaceExpanded(); + 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._fhirserviceBody = this._fhirserviceBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 NewAzHealthcareFhirService_CreateViaIdentityWorkspaceExpanded() + { + + } + + private void PreProcessManagedIdentityParameters() + { + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _fhirserviceBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _fhirserviceBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentity()); + } + } + // calculate IdentityType + if (this.UserAssignedIdentity?.Length > 0) + { + if ("SystemAssigned".Equals(_fhirserviceBody.IdentityType, StringComparison.InvariantCultureIgnoreCase)) + { + _fhirserviceBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else + { + _fhirserviceBody.IdentityType = "UserAssigned"; + } + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FhirServicesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (WorkspaceInputObject?.Id != null) + { + this.WorkspaceInputObject.Id += $"/fhirservices/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + this.PreProcessManagedIdentityParameters(); + await this.Client.FhirServicesCreateOrUpdateViaIdentity(WorkspaceInputObject.Id, _fhirserviceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == WorkspaceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + this.PreProcessManagedIdentityParameters(); + await this.Client.FhirServicesCreateOrUpdate(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, Name, _fhirserviceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IFhirService + /// 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.HealthcareApis.Models.IFhirService + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcarePrivateEndpointConnection_CreateExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareFhirService_CreateViaJsonFilePath.cs similarity index 79% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcarePrivateEndpointConnection_CreateExpanded.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareFhirService_CreateViaJsonFilePath.cs index 1763feeba68d..ecd31e2a5eb6 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcarePrivateEndpointConnection_CreateExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareFhirService_CreateViaJsonFilePath.cs @@ -6,22 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// - /// Update the state of the specified private endpoint connection associated with the service. - /// + /// create a FHIR Service resource with the specified parameters. /// - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcarePrivateEndpointConnection_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Update the state of the specified private endpoint connection associated with the service.")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareFhirService_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create a FHIR Service resource with the specified parameters.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2021-11-01")] - public partial class NewAzHealthcarePrivateEndpointConnection_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", ApiVersion = "2021-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class NewAzHealthcareFhirService_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,8 +39,10 @@ public partial class NewAzHealthcarePrivateEndpointConnection_CreateExpanded : g /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// The Private Endpoint Connection resource. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.PrivateEndpointConnection(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + public global::System.String _jsonString; /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -50,6 +54,9 @@ public partial class NewAzHealthcarePrivateEndpointConnection_CreateExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -63,6 +70,9 @@ public partial class NewAzHealthcarePrivateEndpointConnection_CreateExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -78,6 +88,19 @@ public partial class NewAzHealthcarePrivateEndpointConnection_CreateExpanded : g /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -89,15 +112,15 @@ public partial class NewAzHealthcarePrivateEndpointConnection_CreateExpanded : g /// Backing field for property. private string _name; - /// The name of the private endpoint connection associated with the Azure resource - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private endpoint connection associated with the Azure resource")] + /// The name of FHIR Service resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of FHIR Service resource.")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = true, ReadOnly = false, - Description = @"The name of the private endpoint connection associated with the Azure resource", - SerializedName = @"privateEndpointConnectionName", + Description = @"The name of FHIR Service resource.", + SerializedName = @"fhirServiceName", PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("PrivateEndpointConnectionName")] + [global::System.Management.Automation.Alias("FhirServiceName")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string Name { get => this._name; set => this._name = value; } @@ -112,45 +135,7 @@ public partial class NewAzHealthcarePrivateEndpointConnection_CreateExpanded : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } - - /// - /// A message indicating if changes on the service provider require any updates on the consumer. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A message indicating if changes on the service provider require any updates on the consumer.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"A message indicating if changes on the service provider require any updates on the consumer.", - SerializedName = @"actionsRequired", - PossibleTypes = new [] { typeof(string) })] - public string PrivateLinkServiceConnectionStateActionsRequired { get => _propertiesBody.PrivateLinkServiceConnectionStateActionsRequired ?? null; set => _propertiesBody.PrivateLinkServiceConnectionStateActionsRequired = value; } - - /// The reason for approval/rejection of the connection. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The reason for approval/rejection of the connection.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The reason for approval/rejection of the connection.", - SerializedName = @"description", - PossibleTypes = new [] { typeof(string) })] - public string PrivateLinkServiceConnectionStateDescription { get => _propertiesBody.PrivateLinkServiceConnectionStateDescription ?? null; set => _propertiesBody.PrivateLinkServiceConnectionStateDescription = value; } - - /// - /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", - SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus PrivateLinkServiceConnectionStateStatus { get => _propertiesBody.PrivateLinkServiceConnectionStateStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus)""); set => _propertiesBody.PrivateLinkServiceConnectionStateStatus = value; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,20 +167,6 @@ public partial class NewAzHealthcarePrivateEndpointConnection_CreateExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - /// Backing field for property. - private string _resourceName; - - /// The name of the service instance. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the service instance.")] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the service instance.", - SerializedName = @"resourceName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] - public string ResourceName { get => this._resourceName; set => this._resourceName = value; } - /// Backing field for property. private string _subscriptionId; @@ -210,33 +181,48 @@ public partial class NewAzHealthcarePrivateEndpointConnection_CreateExpanded : g [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + /// Backing field for property. + private string _workspaceName; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string WorkspaceName { get => this._workspaceName; set => this._workspaceName = 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService /// 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) @@ -257,10 +243,10 @@ protected override void BeginProcessing() } /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of NewAzHealthcarePrivateEndpointConnection_CreateExpanded - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcarePrivateEndpointConnection_CreateExpanded Clone() + /// a duplicate instance of NewAzHealthcareFhirService_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareFhirService_CreateViaJsonFilePath Clone() { - var clone = new NewAzHealthcarePrivateEndpointConnection_CreateExpanded(); + var clone = new NewAzHealthcareFhirService_CreateViaJsonFilePath(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; @@ -273,11 +259,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcare clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone._propertiesBody = this._propertiesBody; clone.SubscriptionId = this.SubscriptionId; clone.ResourceGroupName = this.ResourceGroupName; - clone.ResourceName = this.ResourceName; + clone.WorkspaceName = this.WorkspaceName; clone.Name = this.Name; + clone.JsonFilePath = this.JsonFilePath; return clone; } @@ -348,11 +334,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -364,10 +375,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -377,9 +404,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public NewAzHealthcarePrivateEndpointConnection_CreateExpanded() + public NewAzHealthcareFhirService_CreateViaJsonFilePath() { } @@ -392,7 +419,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'PrivateEndpointConnectionsCreateOrUpdate' operation")) + if (ShouldProcess($"Call remote 'FhirServicesCreateOrUpdate' operation")) { if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { @@ -443,7 +470,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -456,12 +483,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PrivateEndpointConnectionsCreateOrUpdate(SubscriptionId, ResourceGroupName, ResourceName, Name, _propertiesBody, onOk, onDefault, this, Pipeline); + await this.Client.FhirServicesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, WorkspaceName, Name, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,ResourceName=ResourceName,Name=Name,body=_propertiesBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -499,12 +526,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -521,15 +548,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.HealthcareApis.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, ResourceName=ResourceName, Name=Name, body=_propertiesBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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, ResourceName=ResourceName, Name=Name, body=_propertiesBody }) + 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 } }); @@ -539,12 +566,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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService /// 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 ) { @@ -556,8 +583,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareFhirService_CreateViaJsonString.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareFhirService_CreateViaJsonString.cs new file mode 100644 index 000000000000..e32ec9bf9bc5 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareFhirService_CreateViaJsonString.cs @@ -0,0 +1,590 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// create a FHIR Service resource with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareFhirService_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create a FHIR Service resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", ApiVersion = "2021-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class NewAzHealthcareFhirService_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of FHIR Service resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of FHIR Service resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of FHIR Service resource.", + SerializedName = @"fhirServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("FhirServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group that contains the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group that contains the service instance.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _workspaceName; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string WorkspaceName { get => this._workspaceName; set => this._workspaceName = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IFhirService + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzHealthcareFhirService_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareFhirService_CreateViaJsonString Clone() + { + var clone = new NewAzHealthcareFhirService_CreateViaJsonString(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.WorkspaceName = this.WorkspaceName; + clone.Name = this.Name; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 NewAzHealthcareFhirService_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FhirServicesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FhirServicesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, WorkspaceName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IFhirService + /// 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.HealthcareApis.Models.IFhirService + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateExpanded.cs index 402e8f258be4..12c2b3b89379 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateExpanded.cs @@ -6,22 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// - /// Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + /// create an IoT Connector FHIR destination resource with the specified parameters. /// /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareIotConnectorFhirDestination_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Creates or updates an IoT Connector FHIR destination resource with the specified parameters.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create an IoT Connector FHIR destination resource with the specified parameters.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", ApiVersion = "2021-11-01")] public partial class NewAzHealthcareIotConnectorFhirDestination_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,8 +40,11 @@ public partial class NewAzHealthcareIotConnectorFhirDestination_CreateExpanded : /// 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(); + /// IoT Connector FHIR destination definition. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination _iotFhirDestinationBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotFhirDestination(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination _iotFhirDestinationBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestination(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -50,6 +56,9 @@ public partial class NewAzHealthcareIotConnectorFhirDestination_CreateExpanded : [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -76,6 +85,9 @@ public partial class NewAzHealthcareIotConnectorFhirDestination_CreateExpanded : PossibleTypes = new [] { typeof(string) })] public string Etag { get => _iotFhirDestinationBody.Etag ?? null; set => _iotFhirDestinationBody.Etag = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _fhirDestinationName; @@ -99,8 +111,8 @@ public partial class NewAzHealthcareIotConnectorFhirDestination_CreateExpanded : ReadOnly = false, Description = @"The mapping.", SerializedName = @"content", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent FhirMappingContent { get => _iotFhirDestinationBody.FhirMappingContent ?? null /* object */; set => _iotFhirDestinationBody.FhirMappingContent = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent FhirMappingContent { get => _iotFhirDestinationBody.FhirMappingContent ?? null /* object */; set => _iotFhirDestinationBody.FhirMappingContent = value; } /// Fully qualified resource id of the FHIR service to connect to. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Fully qualified resource id of the FHIR service to connect to.")] @@ -172,7 +184,7 @@ public partial class NewAzHealthcareIotConnectorFhirDestination_CreateExpanded : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -212,9 +224,9 @@ public partial class NewAzHealthcareIotConnectorFhirDestination_CreateExpanded : ReadOnly = false, Description = @"Determines how resource identity is resolved on the destination.", SerializedName = @"resourceIdentityResolutionType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType ResourceIdentityResolutionType { get => _iotFhirDestinationBody.ResourceIdentityResolutionType; set => _iotFhirDestinationBody.ResourceIdentityResolutionType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Create", "Lookup")] + public string ResourceIdentityResolutionType { get => _iotFhirDestinationBody.ResourceIdentityResolutionType ?? null; set => _iotFhirDestinationBody.ResourceIdentityResolutionType = value; } /// Backing field for property. private string _subscriptionId; @@ -230,7 +242,8 @@ public partial class NewAzHealthcareIotConnectorFhirDestination_CreateExpanded : [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -253,24 +266,24 @@ public partial class NewAzHealthcareIotConnectorFhirDestination_CreateExpanded : /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IIotFhirDestination + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination /// 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) @@ -310,8 +323,8 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcare clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; clone._iotFhirDestinationBody = this._iotFhirDestinationBody; - clone.ResourceGroupName = this.ResourceGroupName; clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; clone.WorkspaceName = this.WorkspaceName; clone.IotConnectorName = this.IotConnectorName; clone.FhirDestinationName = this.FhirDestinationName; @@ -385,11 +398,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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 +439,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -414,7 +468,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzHealthcareIotConnectorFhirDestination_CreateExpanded() { @@ -480,7 +534,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -493,12 +547,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.IotConnectorFhirDestinationCreateOrUpdate(ResourceGroupName, SubscriptionId, WorkspaceName, IotConnectorName, FhirDestinationName, _iotFhirDestinationBody, onOk, onDefault, this, Pipeline); + await this.Client.IotConnectorFhirDestinationCreateOrUpdate(SubscriptionId, ResourceGroupName, WorkspaceName, IotConnectorName, FhirDestinationName, _iotFhirDestinationBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,WorkspaceName=WorkspaceName,IotConnectorName=IotConnectorName,FhirDestinationName=FhirDestinationName,body=_iotFhirDestinationBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName,IotConnectorName=IotConnectorName,FhirDestinationName=FhirDestinationName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -536,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -558,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.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName, IotConnectorName=IotConnectorName, FhirDestinationName=FhirDestinationName, body=_iotFhirDestinationBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName, IotConnectorName=IotConnectorName, FhirDestinationName=FhirDestinationName, body=_iotFhirDestinationBody }) + 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 } }); @@ -576,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.HealthcareApis.Models.Api20211101.IIotFhirDestination + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination /// 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 ) { @@ -593,8 +647,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateViaIdentityIotconnectorExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateViaIdentityIotconnectorExpanded.cs new file mode 100644 index 000000000000..b3ef8b905a61 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateViaIdentityIotconnectorExpanded.cs @@ -0,0 +1,625 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// + /// create an IoT Connector FHIR destination resource with the specified parameters. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareIotConnectorFhirDestination_CreateViaIdentityIotconnectorExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create an IoT Connector FHIR destination resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", ApiVersion = "2021-11-01")] + public partial class NewAzHealthcareIotConnectorFhirDestination_CreateViaIdentityIotconnectorExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// IoT Connector FHIR destination definition. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination _iotFhirDestinationBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestination(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// An etag associated with the resource, used for optimistic concurrency when editing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An etag associated with the resource, used for optimistic concurrency when editing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _iotFhirDestinationBody.Etag ?? null; set => _iotFhirDestinationBody.Etag = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// Backing field for property. + private string _fhirDestinationName; + + /// The name of IoT Connector FHIR destination resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector FHIR destination resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector FHIR destination resource.", + SerializedName = @"fhirDestinationName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string FhirDestinationName { get => this._fhirDestinationName; set => this._fhirDestinationName = value; } + + /// The mapping. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The mapping.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The mapping.", + SerializedName = @"content", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent FhirMappingContent { get => _iotFhirDestinationBody.FhirMappingContent ?? null /* object */; set => _iotFhirDestinationBody.FhirMappingContent = value; } + + /// Fully qualified resource id of the FHIR service to connect to. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Fully qualified resource id of the FHIR service to connect to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Fully qualified resource id of the FHIR service to connect to.", + SerializedName = @"fhirServiceResourceId", + PossibleTypes = new [] { typeof(string) })] + public string FhirServiceResourceId { get => _iotFhirDestinationBody.FhirServiceResourceId ?? null; set => _iotFhirDestinationBody.FhirServiceResourceId = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _iotconnectorInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity IotconnectorInputObject { get => this._iotconnectorInputObject; set => this._iotconnectorInputObject = value; } + + /// The resource location. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _iotFhirDestinationBody.Location ?? null; set => _iotFhirDestinationBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Determines how resource identity is resolved on the destination. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Determines how resource identity is resolved on the destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Determines how resource identity is resolved on the destination.", + SerializedName = @"resourceIdentityResolutionType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Create", "Lookup")] + public string ResourceIdentityResolutionType { get => _iotFhirDestinationBody.ResourceIdentityResolutionType ?? null; set => _iotFhirDestinationBody.ResourceIdentityResolutionType = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzHealthcareIotConnectorFhirDestination_CreateViaIdentityIotconnectorExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareIotConnectorFhirDestination_CreateViaIdentityIotconnectorExpanded Clone() + { + var clone = new NewAzHealthcareIotConnectorFhirDestination_CreateViaIdentityIotconnectorExpanded(); + 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._iotFhirDestinationBody = this._iotFhirDestinationBody; + clone.FhirDestinationName = this.FhirDestinationName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 NewAzHealthcareIotConnectorFhirDestination_CreateViaIdentityIotconnectorExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IotConnectorFhirDestinationCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (IotconnectorInputObject?.Id != null) + { + this.IotconnectorInputObject.Id += $"/fhirdestinations/{(global::System.Uri.EscapeDataString(this.FhirDestinationName.ToString()))}"; + await this.Client.IotConnectorFhirDestinationCreateOrUpdateViaIdentity(IotconnectorInputObject.Id, _iotFhirDestinationBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == IotconnectorInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + if (null == IotconnectorInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + if (null == IotconnectorInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + if (null == IotconnectorInputObject.IotConnectorName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.IotConnectorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + await this.Client.IotConnectorFhirDestinationCreateOrUpdate(IotconnectorInputObject.SubscriptionId ?? null, IotconnectorInputObject.ResourceGroupName ?? null, IotconnectorInputObject.WorkspaceName ?? null, IotconnectorInputObject.IotConnectorName ?? null, FhirDestinationName, _iotFhirDestinationBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { FhirDestinationName=FhirDestinationName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Models.IIotFhirDestination + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateViaIdentityWorkspaceExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateViaIdentityWorkspaceExpanded.cs new file mode 100644 index 000000000000..7a1b88ed8b28 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateViaIdentityWorkspaceExpanded.cs @@ -0,0 +1,636 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// + /// create an IoT Connector FHIR destination resource with the specified parameters. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareIotConnectorFhirDestination_CreateViaIdentityWorkspaceExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create an IoT Connector FHIR destination resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", ApiVersion = "2021-11-01")] + public partial class NewAzHealthcareIotConnectorFhirDestination_CreateViaIdentityWorkspaceExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// IoT Connector FHIR destination definition. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination _iotFhirDestinationBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestination(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// An etag associated with the resource, used for optimistic concurrency when editing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An etag associated with the resource, used for optimistic concurrency when editing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _iotFhirDestinationBody.Etag ?? null; set => _iotFhirDestinationBody.Etag = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// Backing field for property. + private string _fhirDestinationName; + + /// The name of IoT Connector FHIR destination resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector FHIR destination resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector FHIR destination resource.", + SerializedName = @"fhirDestinationName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string FhirDestinationName { get => this._fhirDestinationName; set => this._fhirDestinationName = value; } + + /// The mapping. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The mapping.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The mapping.", + SerializedName = @"content", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent FhirMappingContent { get => _iotFhirDestinationBody.FhirMappingContent ?? null /* object */; set => _iotFhirDestinationBody.FhirMappingContent = value; } + + /// Fully qualified resource id of the FHIR service to connect to. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Fully qualified resource id of the FHIR service to connect to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Fully qualified resource id of the FHIR service to connect to.", + SerializedName = @"fhirServiceResourceId", + PossibleTypes = new [] { typeof(string) })] + public string FhirServiceResourceId { get => _iotFhirDestinationBody.FhirServiceResourceId ?? null; set => _iotFhirDestinationBody.FhirServiceResourceId = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _iotConnectorName; + + /// The name of IoT Connector resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector resource.", + SerializedName = @"iotConnectorName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string IotConnectorName { get => this._iotConnectorName; set => this._iotConnectorName = value; } + + /// The resource location. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _iotFhirDestinationBody.Location ?? null; set => _iotFhirDestinationBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Determines how resource identity is resolved on the destination. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Determines how resource identity is resolved on the destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Determines how resource identity is resolved on the destination.", + SerializedName = @"resourceIdentityResolutionType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Create", "Lookup")] + public string ResourceIdentityResolutionType { get => _iotFhirDestinationBody.ResourceIdentityResolutionType ?? null; set => _iotFhirDestinationBody.ResourceIdentityResolutionType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _workspaceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity WorkspaceInputObject { get => this._workspaceInputObject; set => this._workspaceInputObject = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzHealthcareIotConnectorFhirDestination_CreateViaIdentityWorkspaceExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareIotConnectorFhirDestination_CreateViaIdentityWorkspaceExpanded Clone() + { + var clone = new NewAzHealthcareIotConnectorFhirDestination_CreateViaIdentityWorkspaceExpanded(); + 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._iotFhirDestinationBody = this._iotFhirDestinationBody; + clone.IotConnectorName = this.IotConnectorName; + clone.FhirDestinationName = this.FhirDestinationName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 NewAzHealthcareIotConnectorFhirDestination_CreateViaIdentityWorkspaceExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IotConnectorFhirDestinationCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (WorkspaceInputObject?.Id != null) + { + this.WorkspaceInputObject.Id += $"/iotconnectors/{(global::System.Uri.EscapeDataString(this.IotConnectorName.ToString()))}/fhirdestinations/{(global::System.Uri.EscapeDataString(this.FhirDestinationName.ToString()))}"; + await this.Client.IotConnectorFhirDestinationCreateOrUpdateViaIdentity(WorkspaceInputObject.Id, _iotFhirDestinationBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == WorkspaceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + await this.Client.IotConnectorFhirDestinationCreateOrUpdate(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, IotConnectorName, FhirDestinationName, _iotFhirDestinationBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IotConnectorName=IotConnectorName,FhirDestinationName=FhirDestinationName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Models.IIotFhirDestination + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateViaJsonFilePath.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..c059fef19924 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateViaJsonFilePath.cs @@ -0,0 +1,611 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// + /// create an IoT Connector FHIR destination resource with the specified parameters. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareIotConnectorFhirDestination_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create an IoT Connector FHIR destination resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", ApiVersion = "2021-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class NewAzHealthcareIotConnectorFhirDestination_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + public global::System.String _jsonString; + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 _fhirDestinationName; + + /// The name of IoT Connector FHIR destination resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector FHIR destination resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector FHIR destination resource.", + SerializedName = @"fhirDestinationName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string FhirDestinationName { get => this._fhirDestinationName; set => this._fhirDestinationName = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _iotConnectorName; + + /// The name of IoT Connector resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector resource.", + SerializedName = @"iotConnectorName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string IotConnectorName { get => this._iotConnectorName; set => this._iotConnectorName = value; } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group that contains the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group that contains the service instance.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _workspaceName; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string WorkspaceName { get => this._workspaceName; set => this._workspaceName = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzHealthcareIotConnectorFhirDestination_CreateViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareIotConnectorFhirDestination_CreateViaJsonFilePath Clone() + { + var clone = new NewAzHealthcareIotConnectorFhirDestination_CreateViaJsonFilePath(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.WorkspaceName = this.WorkspaceName; + clone.IotConnectorName = this.IotConnectorName; + clone.FhirDestinationName = this.FhirDestinationName; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 NewAzHealthcareIotConnectorFhirDestination_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IotConnectorFhirDestinationCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IotConnectorFhirDestinationCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, WorkspaceName, IotConnectorName, FhirDestinationName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName,IotConnectorName=IotConnectorName,FhirDestinationName=FhirDestinationName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Models.IIotFhirDestination + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateViaJsonString.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateViaJsonString.cs new file mode 100644 index 000000000000..97e5afb0ed77 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnectorFhirDestination_CreateViaJsonString.cs @@ -0,0 +1,609 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// + /// create an IoT Connector FHIR destination resource with the specified parameters. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareIotConnectorFhirDestination_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create an IoT Connector FHIR destination resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", ApiVersion = "2021-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class NewAzHealthcareIotConnectorFhirDestination_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 _fhirDestinationName; + + /// The name of IoT Connector FHIR destination resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector FHIR destination resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector FHIR destination resource.", + SerializedName = @"fhirDestinationName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string FhirDestinationName { get => this._fhirDestinationName; set => this._fhirDestinationName = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _iotConnectorName; + + /// The name of IoT Connector resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector resource.", + SerializedName = @"iotConnectorName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string IotConnectorName { get => this._iotConnectorName; set => this._iotConnectorName = value; } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group that contains the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group that contains the service instance.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _workspaceName; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string WorkspaceName { get => this._workspaceName; set => this._workspaceName = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzHealthcareIotConnectorFhirDestination_CreateViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareIotConnectorFhirDestination_CreateViaJsonString Clone() + { + var clone = new NewAzHealthcareIotConnectorFhirDestination_CreateViaJsonString(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.WorkspaceName = this.WorkspaceName; + clone.IotConnectorName = this.IotConnectorName; + clone.FhirDestinationName = this.FhirDestinationName; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 NewAzHealthcareIotConnectorFhirDestination_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IotConnectorFhirDestinationCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IotConnectorFhirDestinationCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, WorkspaceName, IotConnectorName, FhirDestinationName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName,IotConnectorName=IotConnectorName,FhirDestinationName=FhirDestinationName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Models.IIotFhirDestination + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnector_CreateExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnector_CreateExpanded.cs index e8971faee756..66cd286d3ca5 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnector_CreateExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnector_CreateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Creates or updates an IoT Connector resource with the specified parameters. + /// create an IoT Connector resource with the specified parameters. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareIotConnector_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Creates or updates an IoT Connector resource with the specified parameters.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create an IoT Connector resource with the specified parameters.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", ApiVersion = "2021-11-01")] public partial class NewAzHealthcareIotConnector_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +38,11 @@ public partial class NewAzHealthcareIotConnector_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(); + /// IoT Connector definition. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector _iotConnectorBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnector(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector _iotConnectorBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnector(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -48,6 +54,9 @@ public partial class NewAzHealthcareIotConnector_CreateExpanded : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -70,8 +79,12 @@ public partial class NewAzHealthcareIotConnector_CreateExpanded : global::System ReadOnly = false, Description = @"The mapping.", SerializedName = @"content", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent DeviceMappingContent { get => _iotConnectorBody.DeviceMappingContent ?? null /* object */; set => _iotConnectorBody.DeviceMappingContent = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent DeviceMappingContent { get => _iotConnectorBody.DeviceMappingContent ?? null /* object */; set => _iotConnectorBody.DeviceMappingContent = value; } + + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public global::System.Management.Automation.SwitchParameter EnableSystemAssignedIdentity { set => _iotConnectorBody.IdentityType = value.IsPresent ? "SystemAssigned": null ; } /// /// An etag associated with the resource, used for optimistic concurrency when editing it. @@ -86,6 +99,9 @@ public partial class NewAzHealthcareIotConnector_CreateExpanded : global::System PossibleTypes = new [] { typeof(string) })] public string Etag { get => _iotConnectorBody.Etag ?? null; set => _iotConnectorBody.Etag = 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] @@ -98,36 +114,6 @@ public partial class NewAzHealthcareIotConnector_CreateExpanded : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// - /// Type of identity being specified, currently SystemAssigned and None are allowed. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of identity being specified, currently SystemAssigned and None are allowed.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Type of identity being specified, currently SystemAssigned and None are allowed.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType IdentityType { get => _iotConnectorBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType)""); set => _iotConnectorBody.IdentityType = value; } - - /// - /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM - /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - /// The dictionary values can be empty objects ({}) in requests. - /// - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", - SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _iotConnectorBody.IdentityUserAssignedIdentity ?? null /* object */; set => _iotConnectorBody.IdentityUserAssignedIdentity = value; } - /// Consumer group of the event hub to connected to. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Consumer group of the event hub to connected to.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] @@ -209,7 +195,7 @@ public partial class NewAzHealthcareIotConnector_CreateExpanded : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -255,7 +241,8 @@ public partial class NewAzHealthcareIotConnector_CreateExpanded : global::System [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -268,8 +255,16 @@ public partial class NewAzHealthcareIotConnector_CreateExpanded : global::System ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => _iotConnectorBody.Tag ?? null /* object */; set => _iotConnectorBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => _iotConnectorBody.Tag ?? null /* object */; set => _iotConnectorBody.Tag = value; } + + /// + /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in + /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] + [global::System.Management.Automation.AllowEmptyCollection] + public string[] UserAssignedIdentity { get; set; } /// Backing field for property. private string _workspaceName; @@ -290,24 +285,24 @@ public partial class NewAzHealthcareIotConnector_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IIotConnector + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector /// 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) @@ -345,8 +340,8 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcare clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; clone._iotConnectorBody = this._iotConnectorBody; - clone.ResourceGroupName = this.ResourceGroupName; clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; clone.WorkspaceName = this.WorkspaceName; clone.Name = this.Name; return clone; @@ -419,11 +414,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -435,10 +455,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -448,13 +484,38 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzHealthcareIotConnector_CreateExpanded() { } + private void PreProcessManagedIdentityParameters() + { + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _iotConnectorBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _iotConnectorBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentity()); + } + } + // calculate IdentityType + if (this.UserAssignedIdentity?.Length > 0) + { + if ("SystemAssigned".Equals(_iotConnectorBody.IdentityType, StringComparison.InvariantCultureIgnoreCase)) + { + _iotConnectorBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else + { + _iotConnectorBody.IdentityType = "UserAssigned"; + } + } + } + /// Performs execution of the command. protected override void ProcessRecord() { @@ -514,7 +575,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -527,12 +588,13 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.IotConnectorsCreateOrUpdate(ResourceGroupName, SubscriptionId, WorkspaceName, Name, _iotConnectorBody, onOk, onDefault, this, Pipeline); + this.PreProcessManagedIdentityParameters(); + await this.Client.IotConnectorsCreateOrUpdate(SubscriptionId, ResourceGroupName, WorkspaceName, Name, _iotConnectorBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,WorkspaceName=WorkspaceName,Name=Name,body=_iotConnectorBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -570,12 +632,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -592,15 +654,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.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName, Name=Name, body=_iotConnectorBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, WorkspaceName=WorkspaceName, Name=Name, body=_iotConnectorBody }) + 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 } }); @@ -610,12 +672,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.HealthcareApis.Models.Api20211101.IIotConnector + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector /// 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 ) { @@ -627,8 +689,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnector_CreateViaIdentityWorkspaceExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnector_CreateViaIdentityWorkspaceExpanded.cs new file mode 100644 index 000000000000..eb6f0c73d2d6 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnector_CreateViaIdentityWorkspaceExpanded.cs @@ -0,0 +1,681 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// create an IoT Connector resource with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareIotConnector_CreateViaIdentityWorkspaceExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create an IoT Connector resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", ApiVersion = "2021-11-01")] + public partial class NewAzHealthcareIotConnector_CreateViaIdentityWorkspaceExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// IoT Connector definition. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector _iotConnectorBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnector(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The mapping. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The mapping.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The mapping.", + SerializedName = @"content", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent DeviceMappingContent { get => _iotConnectorBody.DeviceMappingContent ?? null /* object */; set => _iotConnectorBody.DeviceMappingContent = value; } + + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public global::System.Management.Automation.SwitchParameter EnableSystemAssignedIdentity { set => _iotConnectorBody.IdentityType = value.IsPresent ? "SystemAssigned": null ; } + + /// + /// An etag associated with the resource, used for optimistic concurrency when editing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An etag associated with the resource, used for optimistic concurrency when editing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _iotConnectorBody.Etag ?? null; set => _iotConnectorBody.Etag = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Consumer group of the event hub to connected to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Consumer group of the event hub to connected to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Consumer group of the event hub to connected to.", + SerializedName = @"consumerGroup", + PossibleTypes = new [] { typeof(string) })] + public string IngestionEndpointConfigurationConsumerGroup { get => _iotConnectorBody.IngestionEndpointConfigurationConsumerGroup ?? null; set => _iotConnectorBody.IngestionEndpointConfigurationConsumerGroup = value; } + + /// Event Hub name to connect to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Event Hub name to connect to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Event Hub name to connect to.", + SerializedName = @"eventHubName", + PossibleTypes = new [] { typeof(string) })] + public string IngestionEndpointConfigurationEventHubName { get => _iotConnectorBody.IngestionEndpointConfigurationEventHubName ?? null; set => _iotConnectorBody.IngestionEndpointConfigurationEventHubName = value; } + + /// Fully qualified namespace of the Event Hub to connect to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Fully qualified namespace of the Event Hub to connect to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified namespace of the Event Hub to connect to.", + SerializedName = @"fullyQualifiedEventHubNamespace", + PossibleTypes = new [] { typeof(string) })] + public string IngestionEndpointConfigurationFullyQualifiedEventHubNamespace { get => _iotConnectorBody.IngestionEndpointConfigurationFullyQualifiedEventHubNamespace ?? null; set => _iotConnectorBody.IngestionEndpointConfigurationFullyQualifiedEventHubNamespace = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The resource location. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _iotConnectorBody.Location ?? null; set => _iotConnectorBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of IoT Connector resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector resource.", + SerializedName = @"iotConnectorName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("IotConnectorName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => _iotConnectorBody.Tag ?? null /* object */; set => _iotConnectorBody.Tag = value; } + + /// + /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in + /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] + [global::System.Management.Automation.AllowEmptyCollection] + public string[] UserAssignedIdentity { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _workspaceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity WorkspaceInputObject { get => this._workspaceInputObject; set => this._workspaceInputObject = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IIotConnector + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzHealthcareIotConnector_CreateViaIdentityWorkspaceExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareIotConnector_CreateViaIdentityWorkspaceExpanded Clone() + { + var clone = new NewAzHealthcareIotConnector_CreateViaIdentityWorkspaceExpanded(); + 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._iotConnectorBody = this._iotConnectorBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 NewAzHealthcareIotConnector_CreateViaIdentityWorkspaceExpanded() + { + + } + + private void PreProcessManagedIdentityParameters() + { + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _iotConnectorBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _iotConnectorBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentity()); + } + } + // calculate IdentityType + if (this.UserAssignedIdentity?.Length > 0) + { + if ("SystemAssigned".Equals(_iotConnectorBody.IdentityType, StringComparison.InvariantCultureIgnoreCase)) + { + _iotConnectorBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else + { + _iotConnectorBody.IdentityType = "UserAssigned"; + } + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IotConnectorsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (WorkspaceInputObject?.Id != null) + { + this.WorkspaceInputObject.Id += $"/iotconnectors/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + this.PreProcessManagedIdentityParameters(); + await this.Client.IotConnectorsCreateOrUpdateViaIdentity(WorkspaceInputObject.Id, _iotConnectorBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == WorkspaceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + this.PreProcessManagedIdentityParameters(); + await this.Client.IotConnectorsCreateOrUpdate(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, Name, _iotConnectorBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IIotConnector + /// 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.HealthcareApis.Models.IIotConnector + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnector_CreateViaJsonFilePath.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnector_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..baa0f7ae2a98 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnector_CreateViaJsonFilePath.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.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// create an IoT Connector resource with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareIotConnector_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create an IoT Connector resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", ApiVersion = "2021-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class NewAzHealthcareIotConnector_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + public global::System.String _jsonString; + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of IoT Connector resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector resource.", + SerializedName = @"iotConnectorName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("IotConnectorName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group that contains the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group that contains the service instance.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _workspaceName; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string WorkspaceName { get => this._workspaceName; set => this._workspaceName = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IIotConnector + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzHealthcareIotConnector_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareIotConnector_CreateViaJsonFilePath Clone() + { + var clone = new NewAzHealthcareIotConnector_CreateViaJsonFilePath(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.WorkspaceName = this.WorkspaceName; + clone.Name = this.Name; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 NewAzHealthcareIotConnector_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IotConnectorsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IotConnectorsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, WorkspaceName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IIotConnector + /// 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.HealthcareApis.Models.IIotConnector + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnector_CreateViaJsonString.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnector_CreateViaJsonString.cs new file mode 100644 index 000000000000..6feee55d0ed5 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareIotConnector_CreateViaJsonString.cs @@ -0,0 +1,590 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// create an IoT Connector resource with the specified parameters. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareIotConnector_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create an IoT Connector resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", ApiVersion = "2021-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class NewAzHealthcareIotConnector_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of IoT Connector resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector resource.", + SerializedName = @"iotConnectorName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("IotConnectorName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group that contains the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group that contains the service instance.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _workspaceName; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string WorkspaceName { get => this._workspaceName; set => this._workspaceName = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IIotConnector + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzHealthcareIotConnector_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareIotConnector_CreateViaJsonString Clone() + { + var clone = new NewAzHealthcareIotConnector_CreateViaJsonString(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.WorkspaceName = this.WorkspaceName; + clone.Name = this.Name; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 NewAzHealthcareIotConnector_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IotConnectorsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IotConnectorsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, WorkspaceName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IIotConnector + /// 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.HealthcareApis.Models.IIotConnector + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareWorkspacePrivateEndpointConnection_CreateExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareWorkspacePrivateEndpointConnection_CreateExpanded.cs index 9b1c319bb6c6..9104622f0e91 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareWorkspacePrivateEndpointConnection_CreateExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareWorkspacePrivateEndpointConnection_CreateExpanded.cs @@ -6,22 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// - /// Update the state of the specified private endpoint connection associated with the workspace. + /// create the state of the specified private endpoint connection associated with the workspace. /// /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareWorkspacePrivateEndpointConnection_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Update the state of the specified private endpoint connection associated with the workspace.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create the state of the specified private endpoint connection associated with the workspace.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2021-11-01")] public partial class NewAzHealthcareWorkspacePrivateEndpointConnection_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,8 +40,11 @@ public partial class NewAzHealthcareWorkspacePrivateEndpointConnection_CreateExp /// 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(); + /// The Private Endpoint Connection resource. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.PrivateEndpointConnectionDescription(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionDescription(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -50,6 +56,9 @@ public partial class NewAzHealthcareWorkspacePrivateEndpointConnection_CreateExp [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -63,6 +72,9 @@ public partial class NewAzHealthcareWorkspacePrivateEndpointConnection_CreateExp [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +109,7 @@ public partial class NewAzHealthcareWorkspacePrivateEndpointConnection_CreateExp /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateEndpointConnectionName; @@ -147,9 +159,9 @@ public partial class NewAzHealthcareWorkspacePrivateEndpointConnection_CreateExp ReadOnly = false, Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus PrivateLinkServiceConnectionStateStatus { get => _propertiesBody.PrivateLinkServiceConnectionStateStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus)""); set => _propertiesBody.PrivateLinkServiceConnectionStateStatus = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + public string PrivateLinkServiceConnectionStateStatus { get => _propertiesBody.PrivateLinkServiceConnectionStateStatus ?? null; set => _propertiesBody.PrivateLinkServiceConnectionStateStatus = 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")] @@ -195,7 +207,8 @@ public partial class NewAzHealthcareWorkspacePrivateEndpointConnection_CreateExp [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -218,24 +231,24 @@ public partial class NewAzHealthcareWorkspacePrivateEndpointConnection_CreateExp /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription /// 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) @@ -349,11 +362,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -365,10 +403,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -378,7 +432,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public NewAzHealthcareWorkspacePrivateEndpointConnection_CreateExpanded() @@ -445,7 +499,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -458,12 +512,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WorkspacePrivateEndpointConnectionsCreateOrUpdate(SubscriptionId, ResourceGroupName, WorkspaceName, PrivateEndpointConnectionName, _propertiesBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkspacePrivateEndpointConnectionsCreateOrUpdate(SubscriptionId, ResourceGroupName, WorkspaceName, PrivateEndpointConnectionName, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName,PrivateEndpointConnectionName=PrivateEndpointConnectionName,body=_propertiesBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName,PrivateEndpointConnectionName=PrivateEndpointConnectionName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -501,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -523,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.HealthcareApis.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, WorkspaceName=WorkspaceName, PrivateEndpointConnectionName=PrivateEndpointConnectionName, body=_propertiesBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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, WorkspaceName=WorkspaceName, PrivateEndpointConnectionName=PrivateEndpointConnectionName, body=_propertiesBody }) + 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 } }); @@ -541,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.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription /// 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 ) { @@ -558,8 +612,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaIdentityWorkspaceExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaIdentityWorkspaceExpanded.cs new file mode 100644 index 000000000000..753580581255 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaIdentityWorkspaceExpanded.cs @@ -0,0 +1,600 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// + /// create the state of the specified private endpoint connection associated with the workspace. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareWorkspacePrivateEndpointConnection_CreateViaIdentityWorkspaceExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create the state of the specified private endpoint connection associated with the workspace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2021-11-01")] + public partial class NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaIdentityWorkspaceExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// The Private Endpoint Connection resource. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionDescription(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateEndpointConnectionName; + + /// The name of the private endpoint connection associated with the Azure resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private endpoint connection associated with the Azure resource")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the private endpoint connection associated with the Azure resource", + SerializedName = @"privateEndpointConnectionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string PrivateEndpointConnectionName { get => this._privateEndpointConnectionName; set => this._privateEndpointConnectionName = value; } + + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A message indicating if changes on the service provider require any updates on the consumer.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message indicating if changes on the service provider require any updates on the consumer.", + SerializedName = @"actionsRequired", + PossibleTypes = new [] { typeof(string) })] + public string PrivateLinkServiceConnectionStateActionsRequired { get => _propertiesBody.PrivateLinkServiceConnectionStateActionsRequired ?? null; set => _propertiesBody.PrivateLinkServiceConnectionStateActionsRequired = value; } + + /// The reason for approval/rejection of the connection. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The reason for approval/rejection of the connection.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reason for approval/rejection of the connection.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string PrivateLinkServiceConnectionStateDescription { get => _propertiesBody.PrivateLinkServiceConnectionStateDescription ?? null; set => _propertiesBody.PrivateLinkServiceConnectionStateDescription = value; } + + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + public string PrivateLinkServiceConnectionStateStatus { get => _propertiesBody.PrivateLinkServiceConnectionStateStatus ?? null; set => _propertiesBody.PrivateLinkServiceConnectionStateStatus = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _workspaceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity WorkspaceInputObject { get => this._workspaceInputObject; set => this._workspaceInputObject = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IPrivateEndpointConnectionDescription + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaIdentityWorkspaceExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaIdentityWorkspaceExpanded Clone() + { + var clone = new NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaIdentityWorkspaceExpanded(); + 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._propertiesBody = this._propertiesBody; + clone.PrivateEndpointConnectionName = this.PrivateEndpointConnectionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaIdentityWorkspaceExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkspacePrivateEndpointConnectionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (WorkspaceInputObject?.Id != null) + { + this.WorkspaceInputObject.Id += $"/privateEndpointConnections/{(global::System.Uri.EscapeDataString(this.PrivateEndpointConnectionName.ToString()))}"; + await this.Client.WorkspacePrivateEndpointConnectionsCreateOrUpdateViaIdentity(WorkspaceInputObject.Id, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == WorkspaceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + await this.Client.WorkspacePrivateEndpointConnectionsCreateOrUpdate(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, PrivateEndpointConnectionName, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { PrivateEndpointConnectionName=PrivateEndpointConnectionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IPrivateEndpointConnectionDescription + /// 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.HealthcareApis.Models.IPrivateEndpointConnectionDescription + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonFilePath.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..c987fb460fb3 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonFilePath.cs @@ -0,0 +1,596 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// + /// create the state of the specified private endpoint connection associated with the workspace. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create the state of the specified private endpoint connection associated with the workspace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2021-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + public global::System.String _jsonString; + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateEndpointConnectionName; + + /// The name of the private endpoint connection associated with the Azure resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private endpoint connection associated with the Azure resource")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the private endpoint connection associated with the Azure resource", + SerializedName = @"privateEndpointConnectionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string PrivateEndpointConnectionName { get => this._privateEndpointConnectionName; set => this._privateEndpointConnectionName = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group that contains the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group that contains the service instance.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _workspaceName; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string WorkspaceName { get => this._workspaceName; set => this._workspaceName = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IPrivateEndpointConnectionDescription + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonFilePath Clone() + { + var clone = new NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonFilePath(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.WorkspaceName = this.WorkspaceName; + clone.PrivateEndpointConnectionName = this.PrivateEndpointConnectionName; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkspacePrivateEndpointConnectionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.WorkspacePrivateEndpointConnectionsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, WorkspaceName, PrivateEndpointConnectionName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName,PrivateEndpointConnectionName=PrivateEndpointConnectionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IPrivateEndpointConnectionDescription + /// 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.HealthcareApis.Models.IPrivateEndpointConnectionDescription + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonString.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonString.cs new file mode 100644 index 000000000000..75d58f9bf57b --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonString.cs @@ -0,0 +1,594 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// + /// create the state of the specified private endpoint connection associated with the workspace. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"create the state of the specified private endpoint connection associated with the workspace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2021-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateEndpointConnectionName; + + /// The name of the private endpoint connection associated with the Azure resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private endpoint connection associated with the Azure resource")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the private endpoint connection associated with the Azure resource", + SerializedName = @"privateEndpointConnectionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string PrivateEndpointConnectionName { get => this._privateEndpointConnectionName; set => this._privateEndpointConnectionName = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group that contains the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group that contains the service instance.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _workspaceName; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string WorkspaceName { get => this._workspaceName; set => this._workspaceName = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IPrivateEndpointConnectionDescription + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonString Clone() + { + var clone = new NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonString(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.WorkspaceName = this.WorkspaceName; + clone.PrivateEndpointConnectionName = this.PrivateEndpointConnectionName; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 NewAzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkspacePrivateEndpointConnectionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.WorkspacePrivateEndpointConnectionsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, WorkspaceName, PrivateEndpointConnectionName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName,PrivateEndpointConnectionName=PrivateEndpointConnectionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IPrivateEndpointConnectionDescription + /// 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.HealthcareApis.Models.IPrivateEndpointConnectionDescription + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareApisService_Delete.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareApisService_Delete.cs index 6bc81a0d5a09..ae66faecb02d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareApisService_Delete.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareApisService_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Delete a service instance. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", ApiVersion = "2021-11-01")] public partial class RemoveAzHealthcareApisService_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzHealthcareApisService_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(); + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzHealthcareApisService_Delete : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzHealthcareApisService_Delete : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +124,7 @@ public partial class RemoveAzHealthcareApisService_Delete : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +170,8 @@ public partial class RemoveAzHealthcareApisService_Delete : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -167,12 +180,12 @@ public partial class RemoveAzHealthcareApisService_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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 @@ -302,11 +315,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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 +356,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -389,7 +443,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -407,7 +461,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -420,7 +474,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzHealthcareApisService_Delete() { @@ -453,12 +507,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 +529,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.HealthcareApis.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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 } }); @@ -508,7 +562,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -532,7 +586,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareApisService_DeleteViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareApisService_DeleteViaIdentity.cs index 153f68c5d538..730d63e2ac60 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareApisService_DeleteViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareApisService_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Delete a service instance. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", ApiVersion = "2021-11-01")] public partial class RemoveAzHealthcareApisService_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzHealthcareApisService_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(); + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzHealthcareApisService_DeleteViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzHealthcareApisService_DeleteViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -106,7 +118,7 @@ public partial class RemoveAzHealthcareApisService_DeleteViaIdentity : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -129,12 +141,12 @@ public partial class RemoveAzHealthcareApisService_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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 @@ -261,11 +273,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -277,10 +314,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -348,7 +401,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -386,7 +439,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -399,7 +452,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzHealthcareApisService_DeleteViaIdentity() { @@ -432,12 +485,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -454,7 +507,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -487,7 +540,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -511,7 +564,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareApisWorkspace_Delete.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareApisWorkspace_Delete.cs index e12a6a793cf0..37f545cf41e4 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareApisWorkspace_Delete.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareApisWorkspace_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Deletes a specified workspace. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}", ApiVersion = "2021-11-01")] public partial class RemoveAzHealthcareApisWorkspace_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzHealthcareApisWorkspace_Delete : 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(); + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzHealthcareApisWorkspace_Delete : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzHealthcareApisWorkspace_Delete : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -113,7 +125,7 @@ public partial class RemoveAzHealthcareApisWorkspace_Delete : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -159,7 +171,8 @@ public partial class RemoveAzHealthcareApisWorkspace_Delete : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -168,12 +181,12 @@ public partial class RemoveAzHealthcareApisWorkspace_Delete : 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.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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 @@ -303,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -319,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -390,7 +444,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -408,7 +462,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -421,7 +475,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzHealthcareApisWorkspace_Delete() { @@ -454,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.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -476,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.HealthcareApis.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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 } }); @@ -509,7 +563,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -533,7 +587,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareApisWorkspace_DeleteViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareApisWorkspace_DeleteViaIdentity.cs index e892af0bf36c..4f68bf56cb20 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareApisWorkspace_DeleteViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareApisWorkspace_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Deletes a specified workspace. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}", ApiVersion = "2021-11-01")] public partial class RemoveAzHealthcareApisWorkspace_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzHealthcareApisWorkspace_DeleteViaIdentity : 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(); + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzHealthcareApisWorkspace_DeleteViaIdentity : global: [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzHealthcareApisWorkspace_DeleteViaIdentity : global: [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -106,7 +118,7 @@ public partial class RemoveAzHealthcareApisWorkspace_DeleteViaIdentity : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -129,12 +141,12 @@ public partial class RemoveAzHealthcareApisWorkspace_DeleteViaIdentity : 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.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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 @@ -261,11 +273,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -277,10 +314,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -348,7 +401,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -386,7 +439,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -399,7 +452,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzHealthcareApisWorkspace_DeleteViaIdentity() { @@ -432,12 +485,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.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -454,7 +507,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -487,7 +540,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -511,7 +564,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareDicomService_Delete.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareDicomService_Delete.cs index 35d4d4eba089..e07ef12b375d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareDicomService_Delete.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareDicomService_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Deletes a DICOM Service. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", ApiVersion = "2021-11-01")] public partial class RemoveAzHealthcareDicomService_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzHealthcareDicomService_Delete : 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(); + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzHealthcareDicomService_Delete : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzHealthcareDicomService_Delete : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -113,7 +125,7 @@ public partial class RemoveAzHealthcareDicomService_Delete : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -159,7 +171,8 @@ public partial class RemoveAzHealthcareDicomService_Delete : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -182,12 +195,12 @@ public partial class RemoveAzHealthcareDicomService_Delete : 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.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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 @@ -318,11 +331,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -334,10 +372,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -405,7 +459,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -423,7 +477,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,WorkspaceName=WorkspaceName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -436,7 +490,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzHealthcareDicomService_Delete() { @@ -469,12 +523,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.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -491,15 +545,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.HealthcareApis.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, WorkspaceName=WorkspaceName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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, WorkspaceName=WorkspaceName }) + 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 } }); @@ -524,7 +578,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -548,7 +602,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareDicomService_DeleteViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareDicomService_DeleteViaIdentity.cs index 1ab5d516a041..ce4b73cf71d3 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareDicomService_DeleteViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareDicomService_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Deletes a DICOM Service. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", ApiVersion = "2021-11-01")] public partial class RemoveAzHealthcareDicomService_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzHealthcareDicomService_DeleteViaIdentity : 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(); + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzHealthcareDicomService_DeleteViaIdentity : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzHealthcareDicomService_DeleteViaIdentity : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -106,7 +118,7 @@ public partial class RemoveAzHealthcareDicomService_DeleteViaIdentity : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -129,12 +141,12 @@ public partial class RemoveAzHealthcareDicomService_DeleteViaIdentity : 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.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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 @@ -261,11 +273,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -277,10 +314,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -348,7 +401,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -390,7 +443,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -403,7 +456,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzHealthcareDicomService_DeleteViaIdentity() { @@ -436,12 +489,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.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// A that will be complete when handling of 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,7 +511,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -491,7 +544,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -515,7 +568,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareDicomService_DeleteViaIdentityDicomservice.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareDicomService_DeleteViaIdentityDicomservice.cs new file mode 100644 index 000000000000..6fa506536199 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareDicomService_DeleteViaIdentityDicomservice.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.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// Deletes a DICOM Service. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzHealthcareDicomService_DeleteViaIdentityDicomservice", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Deletes a DICOM Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", ApiVersion = "2021-11-01")] + public partial class RemoveAzHealthcareDicomService_DeleteViaIdentityDicomservice : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _dicomserviceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity DicomserviceInputObject { get => this._dicomserviceInputObject; set => this._dicomserviceInputObject = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _workspaceName; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string WorkspaceName { get => this._workspaceName; set => this._workspaceName = 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.HealthcareApis.Models.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzHealthcareDicomService_DeleteViaIdentityDicomservice + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.RemoveAzHealthcareDicomService_DeleteViaIdentityDicomservice Clone() + { + var clone = new RemoveAzHealthcareDicomService_DeleteViaIdentityDicomservice(); + 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.WorkspaceName = this.WorkspaceName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DicomServicesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (DicomserviceInputObject?.Id != null) + { + this.DicomserviceInputObject.Id += $"/workspaces/{(global::System.Uri.EscapeDataString(this.WorkspaceName.ToString()))}"; + await this.Client.DicomServicesDeleteViaIdentity(DicomserviceInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == DicomserviceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("DicomserviceInputObject has null value for DicomserviceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, DicomserviceInputObject) ); + } + if (null == DicomserviceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("DicomserviceInputObject has null value for DicomserviceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, DicomserviceInputObject) ); + } + if (null == DicomserviceInputObject.DicomServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("DicomserviceInputObject has null value for DicomserviceInputObject.DicomServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, DicomserviceInputObject) ); + } + await this.Client.DicomServicesDelete(DicomserviceInputObject.SubscriptionId ?? null, DicomserviceInputObject.ResourceGroupName ?? null, DicomserviceInputObject.DicomServiceName ?? null, WorkspaceName, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { WorkspaceName=WorkspaceName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzHealthcareDicomService_DeleteViaIdentityDicomservice() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 == InvocationInformation?.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 == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareFhirService_Delete.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareFhirService_Delete.cs index 50167bf541cc..fee95a833ff3 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareFhirService_Delete.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareFhirService_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Deletes a FHIR Service. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", ApiVersion = "2021-11-01")] public partial class RemoveAzHealthcareFhirService_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzHealthcareFhirService_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(); + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzHealthcareFhirService_Delete : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzHealthcareFhirService_Delete : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -113,7 +125,7 @@ public partial class RemoveAzHealthcareFhirService_Delete : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -159,7 +171,8 @@ public partial class RemoveAzHealthcareFhirService_Delete : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -182,12 +195,12 @@ public partial class RemoveAzHealthcareFhirService_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.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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 @@ -318,11 +331,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -334,10 +372,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -405,7 +459,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -423,7 +477,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,WorkspaceName=WorkspaceName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -436,7 +490,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzHealthcareFhirService_Delete() { @@ -469,12 +523,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.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -491,15 +545,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.HealthcareApis.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, WorkspaceName=WorkspaceName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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, WorkspaceName=WorkspaceName }) + 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 } }); @@ -524,7 +578,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -548,7 +602,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareFhirService_DeleteViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareFhirService_DeleteViaIdentity.cs index a666386cab23..5168686716fd 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareFhirService_DeleteViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareFhirService_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Deletes a FHIR Service. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", ApiVersion = "2021-11-01")] public partial class RemoveAzHealthcareFhirService_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzHealthcareFhirService_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(); + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzHealthcareFhirService_DeleteViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzHealthcareFhirService_DeleteViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -106,7 +118,7 @@ public partial class RemoveAzHealthcareFhirService_DeleteViaIdentity : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -129,12 +141,12 @@ public partial class RemoveAzHealthcareFhirService_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.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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 @@ -261,11 +273,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -277,10 +314,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -348,7 +401,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -390,7 +443,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -403,7 +456,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzHealthcareFhirService_DeleteViaIdentity() { @@ -436,12 +489,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.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// A that will be complete when handling of 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,7 +511,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -491,7 +544,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -515,7 +568,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcarePrivateEndpointConnection_DeleteViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareFhirService_DeleteViaIdentityFhirservice.cs similarity index 79% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcarePrivateEndpointConnection_DeleteViaIdentity.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareFhirService_DeleteViaIdentityFhirservice.cs index 5db9492b4091..530d10bdd47d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcarePrivateEndpointConnection_DeleteViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareFhirService_DeleteViaIdentityFhirservice.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Deletes a private endpoint connection. + /// Deletes a FHIR Service. /// - /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}" /// - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzHealthcarePrivateEndpointConnection_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzHealthcareFhirService_DeleteViaIdentityFhirservice", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Deletes a private endpoint connection.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Deletes a FHIR Service.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2021-11-01")] - public partial class RemoveAzHealthcarePrivateEndpointConnection_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", ApiVersion = "2021-11-01")] + public partial class RemoveAzHealthcareFhirService_DeleteViaIdentityFhirservice : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,6 +37,9 @@ public partial class RemoveAzHealthcarePrivateEndpointConnection_DeleteViaIdenti /// 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(); + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] @@ -45,6 +50,9 @@ public partial class RemoveAzHealthcarePrivateEndpointConnection_DeleteViaIdenti [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -58,6 +66,17 @@ public partial class RemoveAzHealthcarePrivateEndpointConnection_DeleteViaIdenti [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _fhirserviceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity FhirserviceInputObject { get => this._fhirserviceInputObject; set => this._fhirserviceInputObject = 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] @@ -70,14 +89,6 @@ public partial class RemoveAzHealthcarePrivateEndpointConnection_DeleteViaIdenti [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity 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; } } @@ -107,7 +118,7 @@ public partial class RemoveAzHealthcarePrivateEndpointConnection_DeleteViaIdenti /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -125,17 +136,31 @@ public partial class RemoveAzHealthcarePrivateEndpointConnection_DeleteViaIdenti [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + /// Backing field for property. + private string _workspaceName; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string WorkspaceName { get => this._workspaceName; set => this._workspaceName = 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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 @@ -177,11 +202,11 @@ protected override void BeginProcessing() /// Creates a duplicate instance of this cmdlet (via JSON serialization). /// - /// a duplicate instance of RemoveAzHealthcarePrivateEndpointConnection_DeleteViaIdentity + /// a duplicate instance of RemoveAzHealthcareFhirService_DeleteViaIdentityFhirservice /// - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.RemoveAzHealthcarePrivateEndpointConnection_DeleteViaIdentity Clone() + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.RemoveAzHealthcareFhirService_DeleteViaIdentityFhirservice Clone() { - var clone = new RemoveAzHealthcarePrivateEndpointConnection_DeleteViaIdentity(); + var clone = new RemoveAzHealthcareFhirService_DeleteViaIdentityFhirservice(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; @@ -194,6 +219,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.RemoveAzHealthc clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.WorkspaceName = this.WorkspaceName; return clone; } @@ -264,11 +290,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -280,10 +331,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -300,7 +367,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'PrivateEndpointConnectionsDelete' operation")) + if (ShouldProcess($"Call remote 'FhirServicesDelete' operation")) { if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { @@ -351,7 +418,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -364,36 +431,33 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) + if (FhirserviceInputObject?.Id != null) { - await this.Client.PrivateEndpointConnectionsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + this.FhirserviceInputObject.Id += $"/workspaces/{(global::System.Uri.EscapeDataString(this.WorkspaceName.ToString()))}"; + await this.Client.FhirServicesDeleteViaIdentity(FhirserviceInputObject.Id, onOk, onNoContent, 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) + if (null == FhirserviceInputObject.SubscriptionId) { - 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) ); + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("FhirserviceInputObject has null value for FhirserviceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, FhirserviceInputObject) ); } - if (null == InputObject.ResourceName) + if (null == FhirserviceInputObject.ResourceGroupName) { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("FhirserviceInputObject has null value for FhirserviceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, FhirserviceInputObject) ); } - if (null == InputObject.PrivateEndpointConnectionName) + if (null == FhirserviceInputObject.FhirServiceName) { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateEndpointConnectionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("FhirserviceInputObject has null value for FhirserviceInputObject.FhirServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, FhirserviceInputObject) ); } - await this.Client.PrivateEndpointConnectionsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.PrivateEndpointConnectionName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + await this.Client.FhirServicesDelete(FhirserviceInputObject.SubscriptionId ?? null, FhirserviceInputObject.ResourceGroupName ?? null, FhirserviceInputObject.FhirServiceName ?? null, WorkspaceName, onOk, onNoContent, onDefault, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 { WorkspaceName=WorkspaceName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -406,9 +470,9 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public RemoveAzHealthcarePrivateEndpointConnection_DeleteViaIdentity() + public RemoveAzHealthcareFhirService_DeleteViaIdentityFhirservice() { } @@ -439,12 +503,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// A that will be complete when handling of 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,7 +525,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -494,7 +558,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -518,7 +582,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnectorFhirDestination_Delete.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnectorFhirDestination_Delete.cs index 5d64fee41d08..b7ba4d43fd55 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnectorFhirDestination_Delete.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnectorFhirDestination_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Deletes an IoT Connector FHIR destination. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", ApiVersion = "2021-11-01")] public partial class RemoveAzHealthcareIotConnectorFhirDestination_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzHealthcareIotConnectorFhirDestination_Delete : 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(); + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzHealthcareIotConnectorFhirDestination_Delete : glob [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzHealthcareIotConnectorFhirDestination_Delete : glob [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 _fhirDestinationName; @@ -126,7 +138,7 @@ public partial class RemoveAzHealthcareIotConnectorFhirDestination_Delete : glob /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -172,7 +184,8 @@ public partial class RemoveAzHealthcareIotConnectorFhirDestination_Delete : glob [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -195,12 +208,12 @@ public partial class RemoveAzHealthcareIotConnectorFhirDestination_Delete : glob /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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 @@ -332,11 +345,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -348,10 +386,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -419,7 +473,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -437,7 +491,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName,IotConnectorName=IotConnectorName,FhirDestinationName=FhirDestinationName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName,IotConnectorName=IotConnectorName,FhirDestinationName=FhirDestinationName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -450,7 +504,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzHealthcareIotConnectorFhirDestination_Delete() { @@ -483,12 +537,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.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -505,15 +559,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.HealthcareApis.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, WorkspaceName=WorkspaceName, IotConnectorName=IotConnectorName, FhirDestinationName=FhirDestinationName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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, WorkspaceName=WorkspaceName, IotConnectorName=IotConnectorName, FhirDestinationName=FhirDestinationName }) + 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 } }); @@ -538,7 +592,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -562,7 +616,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentity.cs index 04d4e2626d4e..b8d9fd252ced 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Deletes an IoT Connector FHIR destination. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", ApiVersion = "2021-11-01")] public partial class RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIden /// 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(); + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIden [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIden [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -106,7 +118,7 @@ public partial class RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIden /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -129,12 +141,12 @@ public partial class RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIden /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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 @@ -263,11 +275,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -279,10 +316,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -350,7 +403,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -396,7 +449,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -409,7 +462,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentity() @@ -443,12 +496,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.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -465,7 +518,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -498,7 +551,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -522,7 +575,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentityIotconnector.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentityIotconnector.cs new file mode 100644 index 000000000000..48b71070c6ae --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentityIotconnector.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.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// Deletes an IoT Connector FHIR destination. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzHealthcareIotConnectorFhirDestination_DeleteViaIdentityIotconnector", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Deletes an IoT Connector FHIR destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", ApiVersion = "2021-11-01")] + public partial class RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentityIotconnector : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 _fhirDestinationName; + + /// The name of IoT Connector FHIR destination resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector FHIR destination resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector FHIR destination resource.", + SerializedName = @"fhirDestinationName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string FhirDestinationName { get => this._fhirDestinationName; set => this._fhirDestinationName = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _iotconnectorInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity IotconnectorInputObject { get => this._iotconnectorInputObject; set => this._iotconnectorInputObject = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentityIotconnector + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentityIotconnector Clone() + { + var clone = new RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentityIotconnector(); + 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.FhirDestinationName = this.FhirDestinationName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IotConnectorFhirDestinationDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (IotconnectorInputObject?.Id != null) + { + this.IotconnectorInputObject.Id += $"/fhirdestinations/{(global::System.Uri.EscapeDataString(this.FhirDestinationName.ToString()))}"; + await this.Client.IotConnectorFhirDestinationDeleteViaIdentity(IotconnectorInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == IotconnectorInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + if (null == IotconnectorInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + if (null == IotconnectorInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + if (null == IotconnectorInputObject.IotConnectorName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.IotConnectorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + await this.Client.IotConnectorFhirDestinationDelete(IotconnectorInputObject.SubscriptionId ?? null, IotconnectorInputObject.ResourceGroupName ?? null, IotconnectorInputObject.WorkspaceName ?? null, IotconnectorInputObject.IotConnectorName ?? null, FhirDestinationName, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { FhirDestinationName=FhirDestinationName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentityIotconnector() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 == InvocationInformation?.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 == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentityWorkspace.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentityWorkspace.cs new file mode 100644 index 000000000000..665964b57b34 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentityWorkspace.cs @@ -0,0 +1,608 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// Deletes an IoT Connector FHIR destination. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzHealthcareIotConnectorFhirDestination_DeleteViaIdentityWorkspace", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Deletes an IoT Connector FHIR destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", ApiVersion = "2021-11-01")] + public partial class RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentityWorkspace : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 _fhirDestinationName; + + /// The name of IoT Connector FHIR destination resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector FHIR destination resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector FHIR destination resource.", + SerializedName = @"fhirDestinationName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string FhirDestinationName { get => this._fhirDestinationName; set => this._fhirDestinationName = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _iotConnectorName; + + /// The name of IoT Connector resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector resource.", + SerializedName = @"iotConnectorName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string IotConnectorName { get => this._iotConnectorName; set => this._iotConnectorName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _workspaceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity WorkspaceInputObject { get => this._workspaceInputObject; set => this._workspaceInputObject = 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.HealthcareApis.Models.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentityWorkspace + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentityWorkspace Clone() + { + var clone = new RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentityWorkspace(); + 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.IotConnectorName = this.IotConnectorName; + clone.FhirDestinationName = this.FhirDestinationName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IotConnectorFhirDestinationDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (WorkspaceInputObject?.Id != null) + { + this.WorkspaceInputObject.Id += $"/iotconnectors/{(global::System.Uri.EscapeDataString(this.IotConnectorName.ToString()))}/fhirdestinations/{(global::System.Uri.EscapeDataString(this.FhirDestinationName.ToString()))}"; + await this.Client.IotConnectorFhirDestinationDeleteViaIdentity(WorkspaceInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == WorkspaceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + await this.Client.IotConnectorFhirDestinationDelete(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, IotConnectorName, FhirDestinationName, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IotConnectorName=IotConnectorName,FhirDestinationName=FhirDestinationName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzHealthcareIotConnectorFhirDestination_DeleteViaIdentityWorkspace() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 == InvocationInformation?.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 == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnector_Delete.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnector_Delete.cs index 3100241389d9..fdcc2d502993 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnector_Delete.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnector_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Deletes an IoT Connector. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", ApiVersion = "2021-11-01")] public partial class RemoveAzHealthcareIotConnector_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzHealthcareIotConnector_Delete : 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(); + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzHealthcareIotConnector_Delete : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzHealthcareIotConnector_Delete : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -113,7 +125,7 @@ public partial class RemoveAzHealthcareIotConnector_Delete : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -159,7 +171,8 @@ public partial class RemoveAzHealthcareIotConnector_Delete : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -182,12 +195,12 @@ public partial class RemoveAzHealthcareIotConnector_Delete : 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.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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 @@ -318,11 +331,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -334,10 +372,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -405,7 +459,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -423,7 +477,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,WorkspaceName=WorkspaceName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -436,7 +490,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzHealthcareIotConnector_Delete() { @@ -469,12 +523,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.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -491,15 +545,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.HealthcareApis.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, WorkspaceName=WorkspaceName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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, WorkspaceName=WorkspaceName }) + 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 } }); @@ -524,7 +578,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -548,7 +602,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnector_DeleteViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnector_DeleteViaIdentity.cs index a5ab60d42bf2..138accb5eb96 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnector_DeleteViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnector_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Deletes an IoT Connector. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", ApiVersion = "2021-11-01")] public partial class RemoveAzHealthcareIotConnector_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzHealthcareIotConnector_DeleteViaIdentity : 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(); + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzHealthcareIotConnector_DeleteViaIdentity : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzHealthcareIotConnector_DeleteViaIdentity : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -106,7 +118,7 @@ public partial class RemoveAzHealthcareIotConnector_DeleteViaIdentity : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -129,12 +141,12 @@ public partial class RemoveAzHealthcareIotConnector_DeleteViaIdentity : 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.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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 @@ -261,11 +273,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -277,10 +314,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -348,7 +401,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -390,7 +443,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -403,7 +456,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzHealthcareIotConnector_DeleteViaIdentity() { @@ -436,12 +489,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.HealthcareApis.Models.Api20211101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError /// from the remote call /// /// A that will be complete when handling of 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,7 +511,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -491,7 +544,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -515,7 +568,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnector_DeleteViaIdentityIotconnector.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnector_DeleteViaIdentityIotconnector.cs new file mode 100644 index 000000000000..5b7d10d303c2 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareIotConnector_DeleteViaIdentityIotconnector.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.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// Deletes an IoT Connector. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzHealthcareIotConnector_DeleteViaIdentityIotconnector", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Deletes an IoT Connector.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", ApiVersion = "2021-11-01")] + public partial class RemoveAzHealthcareIotConnector_DeleteViaIdentityIotconnector : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _iotconnectorInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity IotconnectorInputObject { get => this._iotconnectorInputObject; set => this._iotconnectorInputObject = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _workspaceName; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string WorkspaceName { get => this._workspaceName; set => this._workspaceName = 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.HealthcareApis.Models.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzHealthcareIotConnector_DeleteViaIdentityIotconnector + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.RemoveAzHealthcareIotConnector_DeleteViaIdentityIotconnector Clone() + { + var clone = new RemoveAzHealthcareIotConnector_DeleteViaIdentityIotconnector(); + 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.WorkspaceName = this.WorkspaceName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IotConnectorsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (IotconnectorInputObject?.Id != null) + { + this.IotconnectorInputObject.Id += $"/workspaces/{(global::System.Uri.EscapeDataString(this.WorkspaceName.ToString()))}"; + await this.Client.IotConnectorsDeleteViaIdentity(IotconnectorInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == IotconnectorInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + if (null == IotconnectorInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + if (null == IotconnectorInputObject.IotConnectorName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.IotConnectorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + await this.Client.IotConnectorsDelete(IotconnectorInputObject.SubscriptionId ?? null, IotconnectorInputObject.ResourceGroupName ?? null, IotconnectorInputObject.IotConnectorName ?? null, WorkspaceName, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { WorkspaceName=WorkspaceName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzHealthcareIotConnector_DeleteViaIdentityIotconnector() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IError + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 == InvocationInformation?.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 == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareWorkspacePrivateEndpointConnection_Delete.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareWorkspacePrivateEndpointConnection_Delete.cs index 3322e3cecd13..52b12b98c3fe 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareWorkspacePrivateEndpointConnection_Delete.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareWorkspacePrivateEndpointConnection_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Deletes a private endpoint connection. @@ -19,7 +21,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2021-11-01")] public partial class RemoveAzHealthcareWorkspacePrivateEndpointConnection_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,6 +38,9 @@ public partial class RemoveAzHealthcareWorkspacePrivateEndpointConnection_Delete /// 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(); + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] @@ -45,6 +51,9 @@ public partial class RemoveAzHealthcareWorkspacePrivateEndpointConnection_Delete [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -58,6 +67,9 @@ public partial class RemoveAzHealthcareWorkspacePrivateEndpointConnection_Delete [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -99,7 +111,7 @@ public partial class RemoveAzHealthcareWorkspacePrivateEndpointConnection_Delete /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateEndpointConnectionName; @@ -159,7 +171,8 @@ public partial class RemoveAzHealthcareWorkspacePrivateEndpointConnection_Delete [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -182,12 +195,12 @@ public partial class RemoveAzHealthcareWorkspacePrivateEndpointConnection_Delete /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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 @@ -320,11 +333,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -336,10 +374,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -407,7 +461,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -425,7 +479,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName,PrivateEndpointConnectionName=PrivateEndpointConnectionName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName,PrivateEndpointConnectionName=PrivateEndpointConnectionName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -438,7 +492,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzHealthcareWorkspacePrivateEndpointConnection_Delete() { @@ -471,12 +525,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -493,15 +547,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.HealthcareApis.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, WorkspaceName=WorkspaceName, PrivateEndpointConnectionName=PrivateEndpointConnectionName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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, WorkspaceName=WorkspaceName, PrivateEndpointConnectionName=PrivateEndpointConnectionName }) + 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,7 +580,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -550,7 +604,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentity.cs index 2a1a8fd06982..ad2e90c69bd8 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Deletes a private endpoint connection. @@ -19,7 +21,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2021-11-01")] public partial class RemoveAzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,6 +38,9 @@ public partial class RemoveAzHealthcareWorkspacePrivateEndpointConnection_Delete /// 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(); + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] @@ -45,6 +51,9 @@ public partial class RemoveAzHealthcareWorkspacePrivateEndpointConnection_Delete [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -58,6 +67,9 @@ public partial class RemoveAzHealthcareWorkspacePrivateEndpointConnection_Delete [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +119,7 @@ public partial class RemoveAzHealthcareWorkspacePrivateEndpointConnection_Delete /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -130,12 +142,12 @@ public partial class RemoveAzHealthcareWorkspacePrivateEndpointConnection_Delete /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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 @@ -264,11 +276,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -280,10 +317,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -351,7 +404,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -393,7 +446,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 } }); @@ -406,7 +459,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the + /// Initializes a new instance of the /// cmdlet class. /// public RemoveAzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentity() @@ -440,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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -462,7 +515,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.HealthcareApis.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -495,7 +548,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -519,7 +572,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentityWorkspace.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentityWorkspace.cs new file mode 100644 index 000000000000..82fcbae4ae64 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/RemoveAzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentityWorkspace.cs @@ -0,0 +1,594 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// Deletes a private endpoint connection. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentityWorkspace", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Deletes a private endpoint connection.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2021-11-01")] + public partial class RemoveAzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentityWorkspace : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateEndpointConnectionName; + + /// The name of the private endpoint connection associated with the Azure resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private endpoint connection associated with the Azure resource")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the private endpoint connection associated with the Azure resource", + SerializedName = @"privateEndpointConnectionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string PrivateEndpointConnectionName { get => this._privateEndpointConnectionName; set => this._privateEndpointConnectionName = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _workspaceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity WorkspaceInputObject { get => this._workspaceInputObject; set => this._workspaceInputObject = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentityWorkspace + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.RemoveAzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentityWorkspace Clone() + { + var clone = new RemoveAzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentityWorkspace(); + 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.PrivateEndpointConnectionName = this.PrivateEndpointConnectionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkspacePrivateEndpointConnectionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (WorkspaceInputObject?.Id != null) + { + this.WorkspaceInputObject.Id += $"/privateEndpointConnections/{(global::System.Uri.EscapeDataString(this.PrivateEndpointConnectionName.ToString()))}"; + await this.Client.WorkspacePrivateEndpointConnectionsDeleteViaIdentity(WorkspaceInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == WorkspaceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + await this.Client.WorkspacePrivateEndpointConnectionsDelete(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, PrivateEndpointConnectionName, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { PrivateEndpointConnectionName=PrivateEndpointConnectionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentityWorkspace() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 == InvocationInformation?.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 == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_Check.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_Check.cs index fbab9eb3e726..213cbf2ad57f 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_Check.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_Check.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Check if a service instance name is available. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] CheckNameAvailability=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzHealthcareServiceNameAvailability_Check", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Check if a service instance name is available.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability", ApiVersion = "2021-11-01")] public partial class TestAzHealthcareServiceNameAvailability_Check : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,13 +37,28 @@ public partial class TestAzHealthcareServiceNameAvailability_Check : 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters _checkNameAvailabilityInput; + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters _checkNameAvailabilityInput; /// Input values. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Input values.", ValueFromPipeline = true)] @@ -49,8 +67,9 @@ public partial class TestAzHealthcareServiceNameAvailability_Check : global::Sys ReadOnly = false, Description = @"Input values.", SerializedName = @"checkNameAvailabilityInputs", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters CheckNameAvailabilityInput { get => this._checkNameAvailabilityInput; set => this._checkNameAvailabilityInput = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters CheckNameAvailabilityInput { get => this._checkNameAvailabilityInput; set => this._checkNameAvailabilityInput = value; } /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -65,6 +84,9 @@ public partial class TestAzHealthcareServiceNameAvailability_Check : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +113,7 @@ public partial class TestAzHealthcareServiceNameAvailability_Check : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -123,7 +145,8 @@ public partial class TestAzHealthcareServiceNameAvailability_Check : global::Sys [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -132,24 +155,24 @@ public partial class TestAzHealthcareServiceNameAvailability_Check : 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo /// 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) @@ -172,6 +195,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -236,8 +264,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -293,7 +346,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -311,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,body=CheckNameAvailabilityInput}) + 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 } }); @@ -331,7 +384,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public TestAzHealthcareServiceNameAvailability_Check() { @@ -357,12 +410,12 @@ public TestAzHealthcareServiceNameAvailability_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -379,15 +432,15 @@ public TestAzHealthcareServiceNameAvailability_Check() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, body=CheckNameAvailabilityInput }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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, body=CheckNameAvailabilityInput }) + 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 } }); @@ -397,12 +450,12 @@ public TestAzHealthcareServiceNameAvailability_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.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo /// 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 ) { @@ -414,8 +467,26 @@ public TestAzHealthcareServiceNameAvailability_Check() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_CheckExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_CheckExpanded.cs index 3d93fef7802d..061d3f431c0d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_CheckExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_CheckExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Check if a service instance name is available. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] CheckNameAvailability=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzHealthcareServiceNameAvailability_CheckExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Check if a service instance name is available.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability", ApiVersion = "2021-11-01")] public partial class TestAzHealthcareServiceNameAvailability_CheckExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,13 +38,28 @@ public partial class TestAzHealthcareServiceNameAvailability_CheckExpanded : glo private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); /// Input values. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters _checkNameAvailabilityInputsBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.CheckNameAvailabilityParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ICheckNameAvailabilityParameters _checkNameAvailabilityInputsBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.CheckNameAvailabilityParameters(); + + /// A dictionary to carry over additional data for pipeline. + private 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -55,6 +73,9 @@ public partial class TestAzHealthcareServiceNameAvailability_CheckExpanded : glo [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +113,7 @@ public partial class TestAzHealthcareServiceNameAvailability_CheckExpanded : glo /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -124,7 +145,8 @@ public partial class TestAzHealthcareServiceNameAvailability_CheckExpanded : glo [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -144,24 +166,24 @@ public partial class TestAzHealthcareServiceNameAvailability_CheckExpanded : 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo /// 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) @@ -184,6 +206,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -248,8 +275,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -305,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -323,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,body=_checkNameAvailabilityInputsBody}) + 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 } }); @@ -343,7 +395,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public TestAzHealthcareServiceNameAvailability_CheckExpanded() { @@ -369,12 +421,12 @@ public TestAzHealthcareServiceNameAvailability_CheckExpanded() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 +443,15 @@ public TestAzHealthcareServiceNameAvailability_CheckExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, body=_checkNameAvailabilityInputsBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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, body=_checkNameAvailabilityInputsBody }) + 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 +461,12 @@ public TestAzHealthcareServiceNameAvailability_CheckExpanded() /// 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.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo /// 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 +478,26 @@ public TestAzHealthcareServiceNameAvailability_CheckExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_CheckViaIdentity.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_CheckViaJsonFilePath.cs similarity index 77% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_CheckViaIdentity.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_CheckViaJsonFilePath.cs index 15dbff3832bd..9f521333af20 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_CheckViaIdentity.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_CheckViaJsonFilePath.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Check if a service instance name is available. /// /// [OpenAPI] CheckNameAvailability=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzHealthcareServiceNameAvailability_CheckViaIdentity", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ParameterSetBreakingChange(new string[] {"CheckViaIdentity"}, "15.0.0", "9.0.0", "2025/11/03")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo))] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzHealthcareServiceNameAvailability_CheckViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Check if a service instance name is available.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability", ApiVersion = "2021-11-01")] - public partial class TestAzHealthcareServiceNameAvailability_CheckViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class TestAzHealthcareServiceNameAvailability_CheckViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,23 +38,27 @@ public partial class TestAzHealthcareServiceNameAvailability_CheckViaIdentity : /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters _checkNameAvailabilityInput; - - /// Input values. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Input values.", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Input values.", - SerializedName = @"checkNameAvailabilityInputs", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters CheckNameAvailabilityInput { get => this._checkNameAvailabilityInput; set => this._checkNameAvailabilityInput = value; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -66,6 +73,9 @@ public partial class TestAzHealthcareServiceNameAvailability_CheckViaIdentity : [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -78,17 +88,22 @@ public partial class TestAzHealthcareServiceNameAvailability_CheckViaIdentity : [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity 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; } } + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Check operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Check operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Check operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -100,7 +115,7 @@ public partial class TestAzHealthcareServiceNameAvailability_CheckViaIdentity : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -118,29 +133,48 @@ public partial class TestAzHealthcareServiceNameAvailability_CheckViaIdentity : [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -163,6 +197,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -227,8 +266,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -284,7 +348,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -297,24 +361,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.ServicesCheckNameAvailabilityViaIdentity(InputObject.Id, CheckNameAvailabilityInput, 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) ); - } - await this.Client.ServicesCheckNameAvailability(InputObject.SubscriptionId ?? null, CheckNameAvailabilityInput, onOk, onDefault, this, Pipeline); - } + await this.Client.ServicesCheckNameAvailabilityViaJsonString(SubscriptionId, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=CheckNameAvailabilityInput}) + 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 } }); @@ -334,9 +386,9 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public TestAzHealthcareServiceNameAvailability_CheckViaIdentity() + public TestAzHealthcareServiceNameAvailability_CheckViaJsonFilePath() { } @@ -360,12 +412,12 @@ public TestAzHealthcareServiceNameAvailability_CheckViaIdentity() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -382,15 +434,15 @@ public TestAzHealthcareServiceNameAvailability_CheckViaIdentity() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=CheckNameAvailabilityInput }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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=CheckNameAvailabilityInput }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -400,12 +452,12 @@ public TestAzHealthcareServiceNameAvailability_CheckViaIdentity() /// 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.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -417,8 +469,26 @@ public TestAzHealthcareServiceNameAvailability_CheckViaIdentity() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_CheckViaIdentityExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_CheckViaJsonString.cs similarity index 78% rename from generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_CheckViaIdentityExpanded.cs rename to generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_CheckViaJsonString.cs index 794fc2ab0250..e7a385e7f96f 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_CheckViaIdentityExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/TestAzHealthcareServiceNameAvailability_CheckViaJsonString.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Check if a service instance name is available. /// /// [OpenAPI] CheckNameAvailability=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzHealthcareServiceNameAvailability_CheckViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.ParameterSetBreakingChange(new string[] {"CheckViaIdentityExpanded"}, "15.0.0", "9.0.0", "2025/11/03")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo))] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzHealthcareServiceNameAvailability_CheckViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Check if a service instance name is available.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability", ApiVersion = "2021-11-01")] - public partial class TestAzHealthcareServiceNameAvailability_CheckViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class TestAzHealthcareServiceNameAvailability_CheckViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,14 +38,26 @@ public partial class TestAzHealthcareServiceNameAvailability_CheckViaIdentityExp /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// Input values. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ICheckNameAvailabilityParameters _checkNameAvailabilityInputsBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.CheckNameAvailabilityParameters(); + /// A dictionary to carry over additional data for pipeline. + private 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -56,6 +71,9 @@ public partial class TestAzHealthcareServiceNameAvailability_CheckViaIdentityExp [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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] @@ -68,17 +86,22 @@ public partial class TestAzHealthcareServiceNameAvailability_CheckViaIdentityExp [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity 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; } } + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Check operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Check operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Check operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -87,21 +110,10 @@ public partial class TestAzHealthcareServiceNameAvailability_CheckViaIdentityExp /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - /// The name of the service instance to check. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the service instance to check.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the service instance to check.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - public string Name { get => _checkNameAvailabilityInputsBody.Name ?? null; set => _checkNameAvailabilityInputsBody.Name = value; } - /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -119,40 +131,48 @@ public partial class TestAzHealthcareServiceNameAvailability_CheckViaIdentityExp [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - /// The fully qualified resource type which includes provider namespace. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The fully qualified resource type which includes provider namespace.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = true, ReadOnly = false, - Description = @"The fully qualified resource type which includes provider namespace.", - SerializedName = @"type", + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] - public string Type { get => _checkNameAvailabilityInputsBody.Type ?? null; set => _checkNameAvailabilityInputsBody.Type = value; } + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo /// 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) @@ -175,6 +195,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -239,8 +264,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +346,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,24 +359,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.ServicesCheckNameAvailabilityViaIdentity(InputObject.Id, _checkNameAvailabilityInputsBody, 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) ); - } - await this.Client.ServicesCheckNameAvailability(InputObject.SubscriptionId ?? null, _checkNameAvailabilityInputsBody, onOk, onDefault, this, Pipeline); - } + await this.Client.ServicesCheckNameAvailabilityViaJsonString(SubscriptionId, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_checkNameAvailabilityInputsBody}) + 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 } }); @@ -346,10 +384,9 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet - /// class. + /// Initializes a new instance of the cmdlet class. /// - public TestAzHealthcareServiceNameAvailability_CheckViaIdentityExpanded() + public TestAzHealthcareServiceNameAvailability_CheckViaJsonString() { } @@ -373,12 +410,12 @@ public TestAzHealthcareServiceNameAvailability_CheckViaIdentityExpanded() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -395,15 +432,15 @@ public TestAzHealthcareServiceNameAvailability_CheckViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_checkNameAvailabilityInputsBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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=_checkNameAvailabilityInputsBody }) + 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 } }); @@ -413,12 +450,12 @@ public TestAzHealthcareServiceNameAvailability_CheckViaIdentityExpanded() /// 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.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo /// 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 ) { @@ -430,8 +467,26 @@ public TestAzHealthcareServiceNameAvailability_CheckViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesNameAvailabilityInfo - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesNameAvailabilityInfo + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisService_UpdateExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisService_UpdateExpanded.cs index ea9361cbffe5..d4d36520acfa 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisService_UpdateExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisService_UpdateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Update the metadata of a service instance. + /// update the metadata of a service instance. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareApisService_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader"}, ChangeDescription="The types of the properties 'PrivateEndpointConnection', 'AccessPolicy', 'AcrConfigurationOciArtifact', 'CorConfigurationOrigin', 'CorConfigurationMethod', 'AcrConfigurationLoginServer', and 'CorConfigurationHeader' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Update the metadata of a service instance.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update the metadata of a service instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", ApiVersion = "2021-11-01")] public partial class UpdateAzHealthcareApisService_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +37,11 @@ public partial class UpdateAzHealthcareApisService_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(); + /// The description of the service. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescription _servicePatchDescriptionBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesPatchDescription(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescription _servicePatchDescriptionBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesPatchDescription(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -48,6 +53,9 @@ public partial class UpdateAzHealthcareApisService_UpdateExpanded : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -61,6 +69,9 @@ public partial class UpdateAzHealthcareApisService_UpdateExpanded : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -109,7 +120,7 @@ public partial class UpdateAzHealthcareApisService_UpdateExpanded : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,9 +148,9 @@ public partial class UpdateAzHealthcareApisService_UpdateExpanded : global::Syst ReadOnly = false, Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess PublicNetworkAccess { get => _servicePatchDescriptionBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess)""); set => _servicePatchDescriptionBody.PublicNetworkAccess = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccess { get => _servicePatchDescriptionBody.PublicNetworkAccess ?? null; set => _servicePatchDescriptionBody.PublicNetworkAccess = value; } /// Backing field for property. private string _resourceGroupName; @@ -169,7 +180,8 @@ public partial class UpdateAzHealthcareApisService_UpdateExpanded : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -182,32 +194,32 @@ public partial class UpdateAzHealthcareApisService_UpdateExpanded : global::Syst ReadOnly = false, Description = @"Instance tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags Tag { get => _servicePatchDescriptionBody.Tag ?? null /* object */; set => _servicePatchDescriptionBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags Tag { get => _servicePatchDescriptionBody.Tag ?? null /* object */; set => _servicePatchDescriptionBody.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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IServicesDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription /// 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) @@ -318,11 +330,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -334,10 +371,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -405,7 +458,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -418,12 +471,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ServicesUpdate(SubscriptionId, ResourceGroupName, Name, _servicePatchDescriptionBody, onOk, onDefault, this, Pipeline); + await this.Client.ServicesUpdate(SubscriptionId, ResourceGroupName, Name, _servicePatchDescriptionBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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=_servicePatchDescriptionBody}) + 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 } }); @@ -443,7 +496,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzHealthcareApisService_UpdateExpanded() { @@ -469,12 +522,12 @@ public UpdateAzHealthcareApisService_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -491,15 +544,15 @@ public UpdateAzHealthcareApisService_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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=_servicePatchDescriptionBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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=_servicePatchDescriptionBody }) + 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 } }); @@ -509,12 +562,12 @@ public UpdateAzHealthcareApisService_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.HealthcareApis.Models.Api20211101.IServicesDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription /// 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 ) { @@ -526,8 +579,9 @@ public UpdateAzHealthcareApisService_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisService_UpdateViaIdentityExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisService_UpdateViaIdentityExpanded.cs index 46edc885ebb6..e96e4c3d64f0 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisService_UpdateViaIdentityExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisService_UpdateViaIdentityExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Update the metadata of a service instance. + /// update the metadata of a service instance. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareApisService_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader"}, ChangeDescription="The types of the properties 'PrivateEndpointConnection', 'AccessPolicy', 'AcrConfigurationOciArtifact', 'CorConfigurationOrigin', 'CorConfigurationMethod', 'AcrConfigurationLoginServer', and 'CorConfigurationHeader' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Update the metadata of a service instance.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update the metadata of a service instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", ApiVersion = "2021-11-01")] public partial class UpdateAzHealthcareApisService_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +37,11 @@ public partial class UpdateAzHealthcareApisService_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(); + /// The description of the service. - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescription _servicePatchDescriptionBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ServicesPatchDescription(); + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescription _servicePatchDescriptionBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.ServicesPatchDescription(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -48,6 +53,9 @@ public partial class UpdateAzHealthcareApisService_UpdateViaIdentityExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -61,6 +69,9 @@ public partial class UpdateAzHealthcareApisService_UpdateViaIdentityExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -103,7 +114,7 @@ public partial class UpdateAzHealthcareApisService_UpdateViaIdentityExpanded : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -131,9 +142,9 @@ public partial class UpdateAzHealthcareApisService_UpdateViaIdentityExpanded : g ReadOnly = false, Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess PublicNetworkAccess { get => _servicePatchDescriptionBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess)""); set => _servicePatchDescriptionBody.PublicNetworkAccess = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccess { get => _servicePatchDescriptionBody.PublicNetworkAccess ?? null; set => _servicePatchDescriptionBody.PublicNetworkAccess = value; } /// Instance tags [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] @@ -144,32 +155,32 @@ public partial class UpdateAzHealthcareApisService_UpdateViaIdentityExpanded : g ReadOnly = false, Description = @"Instance tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesPatchDescriptionTags Tag { get => _servicePatchDescriptionBody.Tag ?? null /* object */; set => _servicePatchDescriptionBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesPatchDescriptionTags Tag { get => _servicePatchDescriptionBody.Tag ?? null /* object */; set => _servicePatchDescriptionBody.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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IServicesDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription /// 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) @@ -277,11 +288,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -293,10 +329,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -364,7 +416,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -379,7 +431,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.ServicesUpdateViaIdentity(InputObject.Id, _servicePatchDescriptionBody, onOk, onDefault, this, Pipeline); + await this.Client.ServicesUpdateViaIdentity(InputObject.Id, _servicePatchDescriptionBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); } else { @@ -396,13 +448,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.ServicesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, _servicePatchDescriptionBody, onOk, onDefault, this, Pipeline); + await this.Client.ServicesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, _servicePatchDescriptionBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_servicePatchDescriptionBody}) + 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 } }); @@ -422,7 +474,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzHealthcareApisService_UpdateViaIdentityExpanded() { @@ -448,12 +500,12 @@ public UpdateAzHealthcareApisService_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 +522,15 @@ public UpdateAzHealthcareApisService_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_servicePatchDescriptionBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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=_servicePatchDescriptionBody }) + 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 +540,12 @@ public UpdateAzHealthcareApisService_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.HealthcareApis.Models.Api20211101.IServicesDescription + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription /// 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 +557,9 @@ public UpdateAzHealthcareApisService_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisService_UpdateViaJsonFilePath.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisService_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..c5ef17f16127 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisService_UpdateViaJsonFilePath.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.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// update the metadata of a service instance. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareApisService_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update the metadata of a service instance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", ApiVersion = "2021-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class UpdateAzHealthcareApisService_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + public global::System.String _jsonString; + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the service instance.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group that contains the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group that contains the service instance.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IServicesDescription + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzHealthcareApisService_UpdateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthcareApisService_UpdateViaJsonFilePath Clone() + { + var clone = new UpdateAzHealthcareApisService_UpdateViaJsonFilePath(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzHealthcareApisService_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IServicesDescription + /// 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.HealthcareApis.Models.IServicesDescription + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisService_UpdateViaJsonString.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisService_UpdateViaJsonString.cs new file mode 100644 index 000000000000..f0c6c4d61774 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisService_UpdateViaJsonString.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.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// update the metadata of a service instance. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareApisService_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update the metadata of a service instance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", ApiVersion = "2021-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class UpdateAzHealthcareApisService_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Update operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the service instance.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group that contains the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group that contains the service instance.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IServicesDescription + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzHealthcareApisService_UpdateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthcareApisService_UpdateViaJsonString Clone() + { + var clone = new UpdateAzHealthcareApisService_UpdateViaJsonString(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzHealthcareApisService_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IServicesDescription + /// 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.HealthcareApis.Models.IServicesDescription + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisWorkspace_UpdateExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisWorkspace_UpdateExpanded.cs index de7811595e1d..14f22f1f9545 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisWorkspace_UpdateExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisWorkspace_UpdateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Patch workspace details. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareApisWorkspace_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection"}, NewOutputProperties=new string[] {"PrivateEndpointConnection"}, ChangeDescription="The types of the properties 'PrivateEndpointConnection' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Patch workspace details.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}", ApiVersion = "2021-11-01")] public partial class UpdateAzHealthcareApisWorkspace_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,10 +37,11 @@ public partial class UpdateAzHealthcareApisWorkspace_UpdateExpanded : global::Sy /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// - /// List of key value pairs that describe the resource. This will overwrite the existing tags. - /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1 _workspacePatchResourceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTags1(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// Workspace patch properties + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePatchResource _workspacePatchResourceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.WorkspacePatchResource(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -50,6 +53,9 @@ public partial class UpdateAzHealthcareApisWorkspace_UpdateExpanded : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -63,6 +69,9 @@ public partial class UpdateAzHealthcareApisWorkspace_UpdateExpanded : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +121,7 @@ public partial class UpdateAzHealthcareApisWorkspace_UpdateExpanded : global::Sy /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +167,8 @@ public partial class UpdateAzHealthcareApisWorkspace_UpdateExpanded : global::Sy [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -171,32 +181,32 @@ public partial class UpdateAzHealthcareApisWorkspace_UpdateExpanded : global::Sy ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => _workspacePatchResourceBody.Tag ?? null /* object */; set => _workspacePatchResourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => _workspacePatchResourceBody.Tag ?? null /* object */; set => _workspacePatchResourceBody.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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IWorkspace + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace /// 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) @@ -234,8 +244,8 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthc clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; clone._workspacePatchResourceBody = this._workspacePatchResourceBody; - clone.ResourceGroupName = this.ResourceGroupName; clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; clone.Name = this.Name; return clone; } @@ -307,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -323,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -394,7 +445,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -407,12 +458,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WorkspacesUpdate(ResourceGroupName, SubscriptionId, Name, _workspacePatchResourceBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkspacesUpdate(SubscriptionId, ResourceGroupName, Name, _workspacePatchResourceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,body=_workspacePatchResourceBody}) + 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 } }); @@ -432,7 +483,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzHealthcareApisWorkspace_UpdateExpanded() { @@ -458,12 +509,12 @@ public UpdateAzHealthcareApisWorkspace_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 +531,15 @@ public UpdateAzHealthcareApisWorkspace_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_workspacePatchResourceBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_workspacePatchResourceBody }) + 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 +549,12 @@ public UpdateAzHealthcareApisWorkspace_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.HealthcareApis.Models.Api20211101.IWorkspace + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace /// 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 +566,9 @@ public UpdateAzHealthcareApisWorkspace_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisWorkspace_UpdateViaIdentityExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisWorkspace_UpdateViaIdentityExpanded.cs index 42140c7b17e3..14e71c2584e9 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisWorkspace_UpdateViaIdentityExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisWorkspace_UpdateViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; /// Patch workspace details. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareApisWorkspace_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection"}, NewOutputProperties=new string[] {"PrivateEndpointConnection"}, ChangeDescription="The types of the properties 'PrivateEndpointConnection' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace))] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Patch workspace details.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}", ApiVersion = "2021-11-01")] public partial class UpdateAzHealthcareApisWorkspace_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,10 +37,11 @@ public partial class UpdateAzHealthcareApisWorkspace_UpdateViaIdentityExpanded : /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// - /// List of key value pairs that describe the resource. This will overwrite the existing tags. - /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags1 _workspacePatchResourceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.ResourceTags1(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// Workspace patch properties + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspacePatchResource _workspacePatchResourceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.WorkspacePatchResource(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -50,6 +53,9 @@ public partial class UpdateAzHealthcareApisWorkspace_UpdateViaIdentityExpanded : [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -63,6 +69,9 @@ public partial class UpdateAzHealthcareApisWorkspace_UpdateViaIdentityExpanded : [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 +114,7 @@ public partial class UpdateAzHealthcareApisWorkspace_UpdateViaIdentityExpanded : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -132,32 +141,32 @@ public partial class UpdateAzHealthcareApisWorkspace_UpdateViaIdentityExpanded : ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => _workspacePatchResourceBody.Tag ?? null /* object */; set => _workspacePatchResourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => _workspacePatchResourceBody.Tag ?? null /* object */; set => _workspacePatchResourceBody.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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IWorkspace + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace /// 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) @@ -267,11 +276,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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 +317,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -354,7 +404,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -369,30 +419,30 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.WorkspacesUpdateViaIdentity(InputObject.Id, _workspacePatchResourceBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkspacesUpdateViaIdentity(InputObject.Id, _workspacePatchResourceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); } else { // try to call with PATH parameters from Input Object - 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.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.WorkspaceName) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.WorkspacesUpdate(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.WorkspaceName ?? null, _workspacePatchResourceBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkspacesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WorkspaceName ?? null, _workspacePatchResourceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_workspacePatchResourceBody}) + 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 } }); @@ -412,7 +462,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzHealthcareApisWorkspace_UpdateViaIdentityExpanded() { @@ -438,12 +488,12 @@ public UpdateAzHealthcareApisWorkspace_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -460,15 +510,15 @@ public UpdateAzHealthcareApisWorkspace_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_workspacePatchResourceBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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=_workspacePatchResourceBody }) + 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 } }); @@ -478,12 +528,12 @@ public UpdateAzHealthcareApisWorkspace_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.HealthcareApis.Models.Api20211101.IWorkspace + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace /// 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 ) { @@ -495,8 +545,9 @@ public UpdateAzHealthcareApisWorkspace_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisWorkspace_UpdateViaJsonFilePath.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisWorkspace_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..7e82baf2ee39 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisWorkspace_UpdateViaJsonFilePath.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.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// Patch workspace details. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareApisWorkspace_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Patch workspace details.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}", ApiVersion = "2021-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class UpdateAzHealthcareApisWorkspace_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + public global::System.String _jsonString; + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("WorkspaceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group that contains the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group that contains the service instance.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IWorkspace + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzHealthcareApisWorkspace_UpdateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthcareApisWorkspace_UpdateViaJsonFilePath Clone() + { + var clone = new UpdateAzHealthcareApisWorkspace_UpdateViaJsonFilePath(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkspacesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.WorkspacesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzHealthcareApisWorkspace_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IWorkspace + /// 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.HealthcareApis.Models.IWorkspace + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisWorkspace_UpdateViaJsonString.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisWorkspace_UpdateViaJsonString.cs new file mode 100644 index 000000000000..fa9cb32fa50c --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareApisWorkspace_UpdateViaJsonString.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.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// Patch workspace details. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareApisWorkspace_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Patch workspace details.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}", ApiVersion = "2021-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.NotSuggestDefaultParameterSet] + public partial class UpdateAzHealthcareApisWorkspace_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Update operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("WorkspaceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group that contains the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group that contains the service instance.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IWorkspace + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzHealthcareApisWorkspace_UpdateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthcareApisWorkspace_UpdateViaJsonString Clone() + { + var clone = new UpdateAzHealthcareApisWorkspace_UpdateViaJsonString(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkspacesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.WorkspacesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzHealthcareApisWorkspace_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IWorkspace + /// 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.HealthcareApis.Models.IWorkspace + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareDicomService_UpdateExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareDicomService_UpdateExpanded.cs index 05084f780a3c..a8f0cf9d0555 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareDicomService_UpdateExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareDicomService_UpdateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Patch DICOM Service details. + /// update a DICOM Service resource with the specified parameters. /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}" + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareDicomService_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","AuthenticationConfigurationAudience","IdentityType","IdentityUserAssignedIdentity"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","AuthenticationConfigurationAudience","IdentityType","IdentityUserAssignedIdentity"}, ChangeDescription="(1)The types of the properties 'PrivateEndpointConnection' and 'AuthenticationConfigurationAudience' will be changed from single object to 'List'. (2)IdentityType will be removed. EnableSystemAssignedIdentity will be used to enable/disable system assigned identity and UserAssignedIdentity will be used to specify user assigned identities.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Patch DICOM Service details.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update a DICOM Service resource with the specified parameters.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", ApiVersion = "2021-11-01")] public partial class UpdateAzHealthcareDicomService_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +37,11 @@ public partial class UpdateAzHealthcareDicomService_UpdateExpanded : global::Sys /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// Dicom Service patch properties - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePatchResource _dicomservicePatchResourceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServicePatchResource(); + /// The description of Dicom Service + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService _dicomserviceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomService(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -48,6 +53,9 @@ public partial class UpdateAzHealthcareDicomService_UpdateExpanded : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -61,6 +69,26 @@ public partial class UpdateAzHealthcareDicomService_UpdateExpanded : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public System.Boolean? EnableSystemAssignedIdentity { get; set; } + + /// + /// An etag associated with the resource, used for optimistic concurrency when editing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An etag associated with the resource, used for optimistic concurrency when editing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _dicomserviceBody.Etag ?? null; set => _dicomserviceBody.Etag = 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] @@ -73,36 +101,6 @@ public partial class UpdateAzHealthcareDicomService_UpdateExpanded : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// - /// Type of identity being specified, currently SystemAssigned and None are allowed. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of identity being specified, currently SystemAssigned and None are allowed.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Type of identity being specified, currently SystemAssigned and None are allowed.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType IdentityType { get => _dicomservicePatchResourceBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType)""); set => _dicomservicePatchResourceBody.IdentityType = value; } - - /// - /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM - /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - /// The dictionary values can be empty objects ({}) in requests. - /// - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", - SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _dicomservicePatchResourceBody.IdentityUserAssignedIdentity ?? null /* object */; set => _dicomservicePatchResourceBody.IdentityUserAssignedIdentity = value; } - /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -140,7 +138,7 @@ public partial class UpdateAzHealthcareDicomService_UpdateExpanded : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,6 +156,20 @@ public partial class UpdateAzHealthcareDicomService_UpdateExpanded : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + /// + /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Control permission for data plane traffic coming from public networks while private endpoint is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccess { get => _dicomserviceBody.PublicNetworkAccess ?? null; set => _dicomserviceBody.PublicNetworkAccess = value; } + /// Backing field for property. private string _resourceGroupName; @@ -186,7 +198,8 @@ public partial class UpdateAzHealthcareDicomService_UpdateExpanded : global::Sys [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -199,8 +212,16 @@ public partial class UpdateAzHealthcareDicomService_UpdateExpanded : global::Sys ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => _dicomservicePatchResourceBody.Tag ?? null /* object */; set => _dicomservicePatchResourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => _dicomserviceBody.Tag ?? null /* object */; set => _dicomserviceBody.Tag = value; } + + /// + /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in + /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] + [global::System.Management.Automation.AllowEmptyCollection] + public string[] UserAssignedIdentity { get; set; } /// Backing field for property. private string _workspaceName; @@ -221,24 +242,24 @@ public partial class UpdateAzHealthcareDicomService_UpdateExpanded : 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IDicomService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService /// 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,11 +296,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthc clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone._dicomservicePatchResourceBody = this._dicomservicePatchResourceBody; - clone.ResourceGroupName = this.ResourceGroupName; + clone._dicomserviceBody = this._dicomserviceBody; clone.SubscriptionId = this.SubscriptionId; - clone.Name = this.Name; + clone.ResourceGroupName = this.ResourceGroupName; clone.WorkspaceName = this.WorkspaceName; + clone.Name = this.Name; return clone; } @@ -350,11 +371,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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 +412,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -378,6 +440,44 @@ protected override void EndProcessing() } } + private void PreProcessManagedIdentityParametersWithGetResult() + { + bool supportsSystemAssignedIdentity = (true == this.EnableSystemAssignedIdentity || null == this.EnableSystemAssignedIdentity && true == _dicomserviceBody?.IdentityType?.Contains("SystemAssigned")); + bool supportsUserAssignedIdentity = false; + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _dicomserviceBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _dicomserviceBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentity()); + } + } + supportsUserAssignedIdentity = true == this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && this.UserAssignedIdentity?.Length > 0 || + true != this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && true == _dicomserviceBody.IdentityType?.Contains("UserAssigned"); + if (!supportsUserAssignedIdentity) + { + _dicomserviceBody.IdentityUserAssignedIdentity = null; + } + // calculate IdentityType + if ((supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _dicomserviceBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else if ((supportsUserAssignedIdentity && !supportsSystemAssignedIdentity)) + { + _dicomserviceBody.IdentityType = "UserAssigned"; + } + else if ((!supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _dicomserviceBody.IdentityType = "SystemAssigned"; + } + else + { + _dicomserviceBody.IdentityType = "None"; + } + } + /// Performs execution of the command. protected override void ProcessRecord() { @@ -386,7 +486,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'DicomServicesUpdate' operation")) + if (ShouldProcess($"Call remote 'DicomServicesCreateOrUpdate' operation")) { if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { @@ -437,7 +537,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -450,12 +550,15 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.DicomServicesUpdate(ResourceGroupName, SubscriptionId, Name, WorkspaceName, _dicomservicePatchResourceBody, onOk, onDefault, this, Pipeline); + _dicomserviceBody = await this.Client.DicomServicesGetWithResult(SubscriptionId, ResourceGroupName, WorkspaceName, Name, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_dicomserviceBody(); + await this.Client.DicomServicesCreateOrUpdate(SubscriptionId, ResourceGroupName, WorkspaceName, Name, _dicomserviceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,WorkspaceName=WorkspaceName,body=_dicomservicePatchResourceBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -475,13 +578,29 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzHealthcareDicomService_UpdateExpanded() { } + private void Update_dicomserviceBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) + { + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Etag"))) + { + this.Etag = (string)(this.MyInvocation?.BoundParameters["Etag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PublicNetworkAccess"))) + { + this.PublicNetworkAccess = (string)(this.MyInvocation?.BoundParameters["PublicNetworkAccess"]); + } + } + /// new protected void WriteObject(object sendToPipeline) { @@ -501,12 +620,12 @@ public UpdateAzHealthcareDicomService_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -523,15 +642,15 @@ public UpdateAzHealthcareDicomService_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, WorkspaceName=WorkspaceName, body=_dicomservicePatchResourceBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, WorkspaceName=WorkspaceName, body=_dicomservicePatchResourceBody }) + 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 } }); @@ -541,12 +660,12 @@ public UpdateAzHealthcareDicomService_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.HealthcareApis.Models.Api20211101.IDicomService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService /// 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 ) { @@ -558,8 +677,9 @@ public UpdateAzHealthcareDicomService_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareDicomService_UpdateViaIdentityExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareDicomService_UpdateViaIdentityExpanded.cs index 21d6689ddf69..dd10b22fa513 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareDicomService_UpdateViaIdentityExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareDicomService_UpdateViaIdentityExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Patch DICOM Service details. + /// update a DICOM Service resource with the specified parameters. /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}" + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareDicomService_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","AuthenticationConfigurationAudience","IdentityType","IdentityUserAssignedIdentity"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","AuthenticationConfigurationAudience","IdentityType","IdentityUserAssignedIdentity"}, ChangeDescription="(1)The types of the properties 'PrivateEndpointConnection' and 'AuthenticationConfigurationAudience' will be changed from single object to 'List'. (2)IdentityType will be removed. EnableSystemAssignedIdentity will be used to enable/disable system assigned identity and UserAssignedIdentity will be used to specify user assigned identities.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Patch DICOM Service details.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update a DICOM Service resource with the specified parameters.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", ApiVersion = "2021-11-01")] public partial class UpdateAzHealthcareDicomService_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +37,11 @@ public partial class UpdateAzHealthcareDicomService_UpdateViaIdentityExpanded : /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// Dicom Service patch properties - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomServicePatchResource _dicomservicePatchResourceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.DicomServicePatchResource(); + /// The description of Dicom Service + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService _dicomserviceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomService(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -48,6 +53,9 @@ public partial class UpdateAzHealthcareDicomService_UpdateViaIdentityExpanded : [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -61,6 +69,26 @@ public partial class UpdateAzHealthcareDicomService_UpdateViaIdentityExpanded : [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public System.Boolean? EnableSystemAssignedIdentity { get; set; } + + /// + /// An etag associated with the resource, used for optimistic concurrency when editing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An etag associated with the resource, used for optimistic concurrency when editing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _dicomserviceBody.Etag ?? null; set => _dicomserviceBody.Etag = 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] @@ -73,36 +101,6 @@ public partial class UpdateAzHealthcareDicomService_UpdateViaIdentityExpanded : [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// - /// Type of identity being specified, currently SystemAssigned and None are allowed. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of identity being specified, currently SystemAssigned and None are allowed.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Type of identity being specified, currently SystemAssigned and None are allowed.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType IdentityType { get => _dicomservicePatchResourceBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType)""); set => _dicomservicePatchResourceBody.IdentityType = value; } - - /// - /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM - /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - /// The dictionary values can be empty objects ({}) in requests. - /// - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", - SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _dicomservicePatchResourceBody.IdentityUserAssignedIdentity ?? null /* object */; set => _dicomservicePatchResourceBody.IdentityUserAssignedIdentity = value; } - /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _inputObject; @@ -133,7 +131,7 @@ public partial class UpdateAzHealthcareDicomService_UpdateViaIdentityExpanded : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -151,6 +149,20 @@ public partial class UpdateAzHealthcareDicomService_UpdateViaIdentityExpanded : [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + /// + /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Control permission for data plane traffic coming from public networks while private endpoint is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccess { get => _dicomserviceBody.PublicNetworkAccess ?? null; set => _dicomserviceBody.PublicNetworkAccess = value; } + /// Resource tags. [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] @@ -160,32 +172,40 @@ public partial class UpdateAzHealthcareDicomService_UpdateViaIdentityExpanded : ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => _dicomservicePatchResourceBody.Tag ?? null /* object */; set => _dicomservicePatchResourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => _dicomserviceBody.Tag ?? null /* object */; set => _dicomserviceBody.Tag = value; } + + /// + /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in + /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] + [global::System.Management.Automation.AllowEmptyCollection] + public string[] UserAssignedIdentity { 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IDicomService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService /// 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) @@ -224,7 +244,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthc clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone._dicomservicePatchResourceBody = this._dicomservicePatchResourceBody; + clone._dicomserviceBody = this._dicomserviceBody; return clone; } @@ -295,11 +315,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -311,10 +356,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -323,6 +384,44 @@ protected override void EndProcessing() } } + private void PreProcessManagedIdentityParametersWithGetResult() + { + bool supportsSystemAssignedIdentity = (true == this.EnableSystemAssignedIdentity || null == this.EnableSystemAssignedIdentity && true == _dicomserviceBody?.IdentityType?.Contains("SystemAssigned")); + bool supportsUserAssignedIdentity = false; + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _dicomserviceBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _dicomserviceBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentity()); + } + } + supportsUserAssignedIdentity = true == this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && this.UserAssignedIdentity?.Length > 0 || + true != this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && true == _dicomserviceBody.IdentityType?.Contains("UserAssigned"); + if (!supportsUserAssignedIdentity) + { + _dicomserviceBody.IdentityUserAssignedIdentity = null; + } + // calculate IdentityType + if ((supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _dicomserviceBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else if ((supportsUserAssignedIdentity && !supportsSystemAssignedIdentity)) + { + _dicomserviceBody.IdentityType = "UserAssigned"; + } + else if ((!supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _dicomserviceBody.IdentityType = "SystemAssigned"; + } + else + { + _dicomserviceBody.IdentityType = "None"; + } + } + /// Performs execution of the command. protected override void ProcessRecord() { @@ -331,7 +430,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'DicomServicesUpdate' operation")) + if (ShouldProcess($"Call remote 'DicomServicesCreateOrUpdate' operation")) { if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { @@ -382,7 +481,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -397,34 +496,40 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.DicomServicesUpdateViaIdentity(InputObject.Id, _dicomservicePatchResourceBody, onOk, onDefault, this, Pipeline); + _dicomserviceBody = await this.Client.DicomServicesGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_dicomserviceBody(); + await this.Client.DicomServicesCreateOrUpdateViaIdentity(InputObject.Id, _dicomserviceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); } else { // try to call with PATH parameters from Input Object - 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.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.DicomServiceName) + if (null == InputObject.ResourceGroupName) { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DicomServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + 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.WorkspaceName) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.DicomServicesUpdate(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.DicomServiceName ?? null, InputObject.WorkspaceName ?? null, _dicomservicePatchResourceBody, onOk, onDefault, this, Pipeline); + if (null == InputObject.DicomServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DicomServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _dicomserviceBody = await this.Client.DicomServicesGetWithResult(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WorkspaceName ?? null, InputObject.DicomServiceName ?? null, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_dicomserviceBody(); + await this.Client.DicomServicesCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WorkspaceName ?? null, InputObject.DicomServiceName ?? null, _dicomserviceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_dicomservicePatchResourceBody}) + 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 } }); @@ -444,13 +549,29 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzHealthcareDicomService_UpdateViaIdentityExpanded() { } + private void Update_dicomserviceBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) + { + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Etag"))) + { + this.Etag = (string)(this.MyInvocation?.BoundParameters["Etag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PublicNetworkAccess"))) + { + this.PublicNetworkAccess = (string)(this.MyInvocation?.BoundParameters["PublicNetworkAccess"]); + } + } + /// new protected void WriteObject(object sendToPipeline) { @@ -470,12 +591,12 @@ public UpdateAzHealthcareDicomService_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -492,15 +613,15 @@ public UpdateAzHealthcareDicomService_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_dicomservicePatchResourceBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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=_dicomservicePatchResourceBody }) + 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 } }); @@ -510,12 +631,12 @@ public UpdateAzHealthcareDicomService_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.HealthcareApis.Models.Api20211101.IDicomService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService /// 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 ) { @@ -527,8 +648,9 @@ public UpdateAzHealthcareDicomService_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareDicomService_UpdateViaIdentityWorkspaceExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareDicomService_UpdateViaIdentityWorkspaceExpanded.cs new file mode 100644 index 000000000000..fb996b003b75 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareDicomService_UpdateViaIdentityWorkspaceExpanded.cs @@ -0,0 +1,671 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// update a DICOM Service resource with the specified parameters. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareDicomService_UpdateViaIdentityWorkspaceExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update a DICOM Service resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + public partial class UpdateAzHealthcareDicomService_UpdateViaIdentityWorkspaceExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// The description of Dicom Service + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService _dicomserviceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.DicomService(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public System.Boolean? EnableSystemAssignedIdentity { get; set; } + + /// + /// An etag associated with the resource, used for optimistic concurrency when editing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An etag associated with the resource, used for optimistic concurrency when editing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _dicomserviceBody.Etag ?? null; set => _dicomserviceBody.Etag = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of DICOM Service resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of DICOM Service resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of DICOM Service resource.", + SerializedName = @"dicomServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DicomServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Control permission for data plane traffic coming from public networks while private endpoint is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccess { get => _dicomserviceBody.PublicNetworkAccess ?? null; set => _dicomserviceBody.PublicNetworkAccess = value; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => _dicomserviceBody.Tag ?? null /* object */; set => _dicomserviceBody.Tag = value; } + + /// + /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in + /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] + [global::System.Management.Automation.AllowEmptyCollection] + public string[] UserAssignedIdentity { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _workspaceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity WorkspaceInputObject { get => this._workspaceInputObject; set => this._workspaceInputObject = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IDicomService + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzHealthcareDicomService_UpdateViaIdentityWorkspaceExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthcareDicomService_UpdateViaIdentityWorkspaceExpanded Clone() + { + var clone = new UpdateAzHealthcareDicomService_UpdateViaIdentityWorkspaceExpanded(); + 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._dicomserviceBody = this._dicomserviceBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + private void PreProcessManagedIdentityParametersWithGetResult() + { + bool supportsSystemAssignedIdentity = (true == this.EnableSystemAssignedIdentity || null == this.EnableSystemAssignedIdentity && true == _dicomserviceBody?.IdentityType?.Contains("SystemAssigned")); + bool supportsUserAssignedIdentity = false; + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _dicomserviceBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _dicomserviceBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentity()); + } + } + supportsUserAssignedIdentity = true == this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && this.UserAssignedIdentity?.Length > 0 || + true != this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && true == _dicomserviceBody.IdentityType?.Contains("UserAssigned"); + if (!supportsUserAssignedIdentity) + { + _dicomserviceBody.IdentityUserAssignedIdentity = null; + } + // calculate IdentityType + if ((supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _dicomserviceBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else if ((supportsUserAssignedIdentity && !supportsSystemAssignedIdentity)) + { + _dicomserviceBody.IdentityType = "UserAssigned"; + } + else if ((!supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _dicomserviceBody.IdentityType = "SystemAssigned"; + } + else + { + _dicomserviceBody.IdentityType = "None"; + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DicomServicesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (WorkspaceInputObject?.Id != null) + { + this.WorkspaceInputObject.Id += $"/dicomservices/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + _dicomserviceBody = await this.Client.DicomServicesGetViaIdentityWithResult(WorkspaceInputObject.Id, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_dicomserviceBody(); + await this.Client.DicomServicesCreateOrUpdateViaIdentity(WorkspaceInputObject.Id, _dicomserviceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == WorkspaceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + _dicomserviceBody = await this.Client.DicomServicesGetWithResult(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, Name, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_dicomserviceBody(); + await this.Client.DicomServicesCreateOrUpdate(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, Name, _dicomserviceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzHealthcareDicomService_UpdateViaIdentityWorkspaceExpanded() + { + + } + + private void Update_dicomserviceBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) + { + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Etag"))) + { + this.Etag = (string)(this.MyInvocation?.BoundParameters["Etag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PublicNetworkAccess"))) + { + this.PublicNetworkAccess = (string)(this.MyInvocation?.BoundParameters["PublicNetworkAccess"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IDicomService + /// 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.HealthcareApis.Models.IDicomService + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareFhirService_UpdateExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareFhirService_UpdateExpanded.cs index 1585b7b37023..326df2f977ef 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareFhirService_UpdateExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareFhirService_UpdateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Patch FHIR Service details. + /// update a FHIR Service resource with the specified parameters. /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}" + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareFhirService_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader","IdentityType","IdentityUserAssignedIdentity"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader","IdentityType","IdentityUserAssignedIdentity"}, ChangeDescription="(1)The types of the properties 'PrivateEndpointConnection' and 'AuthenticationConfigurationAudience' will be changed from single object to 'List'. (2)IdentityType will be removed. EnableSystemAssignedIdentity will be used to enable/disable system assigned identity and UserAssignedIdentity will be used to specify user assigned identities.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Patch FHIR Service details.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update a FHIR Service resource with the specified parameters.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", ApiVersion = "2021-11-01")] public partial class UpdateAzHealthcareFhirService_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,22 +37,144 @@ public partial class UpdateAzHealthcareFhirService_UpdateExpanded : global::Syst /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// FhirService patch properties - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePatchResource _fhirservicePatchResourceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServicePatchResource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// The description of Fhir Service + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService _fhirserviceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirService(); + + /// Fhir Service access policies. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Fhir Service access policies.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fhir Service access policies.", + SerializedName = @"accessPolicies", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry[] AccessPolicyObjectId { get => _fhirserviceBody.AccessPolicy?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.AccessPolicy = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The list of the Azure container registry login servers. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of the Azure container registry login servers.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of the Azure container registry login servers.", + SerializedName = @"loginServers", + PossibleTypes = new [] { typeof(string) })] + public string[] AcrConfigurationLoginServer { get => _fhirserviceBody.AcrConfigurationLoginServer?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.AcrConfigurationLoginServer = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The list of Open Container Initiative (OCI) artifacts. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of Open Container Initiative (OCI) artifacts.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of Open Container Initiative (OCI) artifacts.", + SerializedName = @"ociArtifacts", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get => _fhirserviceBody.AcrConfigurationOciArtifact?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.AcrConfigurationOciArtifact = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// If credentials are allowed via CORS. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If credentials are allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If credentials are allowed via CORS.", + SerializedName = @"allowCredentials", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowCorsCredential { get => _fhirserviceBody.CorConfigurationAllowCredentials ?? default(global::System.Management.Automation.SwitchParameter); set => _fhirserviceBody.CorConfigurationAllowCredentials = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + /// The audience url for the service + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The audience url for the service")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The audience url for the service", + SerializedName = @"audience", + PossibleTypes = new [] { typeof(string) })] + public string Audience { get => _fhirserviceBody.AuthenticationConfigurationAudience ?? null; set => _fhirserviceBody.AuthenticationConfigurationAudience = value; } + + /// The authority url for the service + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The authority url for the service")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The authority url for the service", + SerializedName = @"authority", + PossibleTypes = new [] { typeof(string) })] + public string Authority { get => _fhirserviceBody.AuthenticationConfigurationAuthority ?? null; set => _fhirserviceBody.AuthenticationConfigurationAuthority = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; + /// The headers to be allowed via CORS. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The headers to be allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The headers to be allowed via CORS.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(string) })] + public string[] CorsHeader { get => _fhirserviceBody.CorConfigurationHeader?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.CorConfigurationHeader = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The max age to be allowed via CORS. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The max age to be allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The max age to be allowed via CORS.", + SerializedName = @"maxAge", + PossibleTypes = new [] { typeof(int) })] + public int CorsMaxAge { get => _fhirserviceBody.CorConfigurationMaxAge ?? default(int); set => _fhirserviceBody.CorConfigurationMaxAge = value; } + + /// The methods to be allowed via CORS. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The methods to be allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The methods to be allowed via CORS.", + SerializedName = @"methods", + PossibleTypes = new [] { typeof(string) })] + public string[] CorsMethod { get => _fhirserviceBody.CorConfigurationMethod?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.CorConfigurationMethod = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The origins to be allowed via CORS. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The origins to be allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The origins to be allowed via CORS.", + SerializedName = @"origins", + PossibleTypes = new [] { typeof(string) })] + public string[] CorsOrigin { get => _fhirserviceBody.CorConfigurationOrigin?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.CorConfigurationOrigin = (value != null ? new System.Collections.Generic.List(value) : null); } + /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet /// against a different subscription @@ -61,6 +185,48 @@ public partial class UpdateAzHealthcareFhirService_UpdateExpanded : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// If the SMART on FHIR proxy is enabled + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If the SMART on FHIR proxy is enabled")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If the SMART on FHIR proxy is enabled", + SerializedName = @"smartProxyEnabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableSmartProxy { get => _fhirserviceBody.AuthenticationConfigurationSmartProxyEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _fhirserviceBody.AuthenticationConfigurationSmartProxyEnabled = value; } + + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public System.Boolean? EnableSystemAssignedIdentity { get; set; } + + /// + /// An etag associated with the resource, used for optimistic concurrency when editing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An etag associated with the resource, used for optimistic concurrency when editing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _fhirserviceBody.Etag ?? null; set => _fhirserviceBody.Etag = value; } + + /// The name of the default export storage account. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the default export storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the default export storage account.", + SerializedName = @"storageAccountName", + PossibleTypes = new [] { typeof(string) })] + public string ExportStorageAccountName { get => _fhirserviceBody.ExportConfigurationStorageAccountName ?? null; set => _fhirserviceBody.ExportConfigurationStorageAccountName = 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] @@ -73,38 +239,20 @@ public partial class UpdateAzHealthcareFhirService_UpdateExpanded : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// - /// Type of identity being specified, currently SystemAssigned and None are allowed. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of identity being specified, currently SystemAssigned and None are allowed.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Type of identity being specified, currently SystemAssigned and None are allowed.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType IdentityType { get => _fhirservicePatchResourceBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType)""); set => _fhirservicePatchResourceBody.IdentityType = value; } + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - /// - /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM - /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - /// The dictionary values can be empty objects ({}) in requests. - /// - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.")] + /// The kind of the service. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The kind of the service.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, - Description = @"The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", - SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _fhirservicePatchResourceBody.IdentityUserAssignedIdentity ?? null /* object */; set => _fhirservicePatchResourceBody.IdentityUserAssignedIdentity = value; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + Description = @"The kind of the service.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir-Stu3", "fhir-R4")] + public string Kind { get => _fhirserviceBody.Kind ?? null; set => _fhirserviceBody.Kind = value; } /// /// cancellation delegate. Stops the cmdlet when called. @@ -140,7 +288,7 @@ public partial class UpdateAzHealthcareFhirService_UpdateExpanded : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,6 +306,20 @@ public partial class UpdateAzHealthcareFhirService_UpdateExpanded : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + /// + /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Control permission for data plane traffic coming from public networks while private endpoint is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccess { get => _fhirserviceBody.PublicNetworkAccess ?? null; set => _fhirserviceBody.PublicNetworkAccess = value; } + /// Backing field for property. private string _resourceGroupName; @@ -172,6 +334,30 @@ public partial class UpdateAzHealthcareFhirService_UpdateExpanded : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + /// The default value for tracking history across all resources. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default value for tracking history across all resources.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value for tracking history across all resources.", + SerializedName = @"default", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("no-version", "versioned", "versioned-update")] + public string ResourceVersionPolicyConfigurationDefault { get => _fhirserviceBody.ResourceVersionPolicyConfigurationDefault ?? null; set => _fhirserviceBody.ResourceVersionPolicyConfigurationDefault = value; } + + /// A list of FHIR Resources and their version policy overrides. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A list of FHIR Resources and their version policy overrides.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of FHIR Resources and their version policy overrides.", + SerializedName = @"resourceTypeOverrides", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceVersionPolicyConfigurationResourceTypeOverride { get => _fhirserviceBody.ResourceVersionPolicyConfigurationResourceTypeOverride ?? null /* object */; set => _fhirserviceBody.ResourceVersionPolicyConfigurationResourceTypeOverride = value; } + /// Backing field for property. private string _subscriptionId; @@ -186,7 +372,8 @@ public partial class UpdateAzHealthcareFhirService_UpdateExpanded : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -199,8 +386,16 @@ public partial class UpdateAzHealthcareFhirService_UpdateExpanded : global::Syst ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => _fhirservicePatchResourceBody.Tag ?? null /* object */; set => _fhirservicePatchResourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => _fhirserviceBody.Tag ?? null /* object */; set => _fhirserviceBody.Tag = value; } + + /// + /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in + /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] + [global::System.Management.Automation.AllowEmptyCollection] + public string[] UserAssignedIdentity { get; set; } /// Backing field for property. private string _workspaceName; @@ -221,24 +416,24 @@ public partial class UpdateAzHealthcareFhirService_UpdateExpanded : 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IFhirService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService /// 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,11 +470,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthc clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone._fhirservicePatchResourceBody = this._fhirservicePatchResourceBody; - clone.ResourceGroupName = this.ResourceGroupName; + clone._fhirserviceBody = this._fhirserviceBody; clone.SubscriptionId = this.SubscriptionId; - clone.Name = this.Name; + clone.ResourceGroupName = this.ResourceGroupName; clone.WorkspaceName = this.WorkspaceName; + clone.Name = this.Name; return clone; } @@ -350,11 +545,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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 +586,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -378,6 +614,44 @@ protected override void EndProcessing() } } + private void PreProcessManagedIdentityParametersWithGetResult() + { + bool supportsSystemAssignedIdentity = (true == this.EnableSystemAssignedIdentity || null == this.EnableSystemAssignedIdentity && true == _fhirserviceBody?.IdentityType?.Contains("SystemAssigned")); + bool supportsUserAssignedIdentity = false; + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _fhirserviceBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _fhirserviceBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentity()); + } + } + supportsUserAssignedIdentity = true == this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && this.UserAssignedIdentity?.Length > 0 || + true != this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && true == _fhirserviceBody.IdentityType?.Contains("UserAssigned"); + if (!supportsUserAssignedIdentity) + { + _fhirserviceBody.IdentityUserAssignedIdentity = null; + } + // calculate IdentityType + if ((supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _fhirserviceBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else if ((supportsUserAssignedIdentity && !supportsSystemAssignedIdentity)) + { + _fhirserviceBody.IdentityType = "UserAssigned"; + } + else if ((!supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _fhirserviceBody.IdentityType = "SystemAssigned"; + } + else + { + _fhirserviceBody.IdentityType = "None"; + } + } + /// Performs execution of the command. protected override void ProcessRecord() { @@ -386,7 +660,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'FhirServicesUpdate' operation")) + if (ShouldProcess($"Call remote 'FhirServicesCreateOrUpdate' operation")) { if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { @@ -437,7 +711,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -450,12 +724,15 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.FhirServicesUpdate(ResourceGroupName, SubscriptionId, Name, WorkspaceName, _fhirservicePatchResourceBody, onOk, onDefault, this, Pipeline); + _fhirserviceBody = await this.Client.FhirServicesGetWithResult(SubscriptionId, ResourceGroupName, WorkspaceName, Name, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_fhirserviceBody(); + await this.Client.FhirServicesCreateOrUpdate(SubscriptionId, ResourceGroupName, WorkspaceName, Name, _fhirserviceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,WorkspaceName=WorkspaceName,body=_fhirservicePatchResourceBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -475,13 +752,89 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzHealthcareFhirService_UpdateExpanded() { } + private void Update_fhirserviceBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) + { + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Etag"))) + { + this.Etag = (string)(this.MyInvocation?.BoundParameters["Etag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Kind"))) + { + this.Kind = (string)(this.MyInvocation?.BoundParameters["Kind"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AccessPolicyObjectId"))) + { + this.AccessPolicyObjectId = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry[])(this.MyInvocation?.BoundParameters["AccessPolicyObjectId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PublicNetworkAccess"))) + { + this.PublicNetworkAccess = (string)(this.MyInvocation?.BoundParameters["PublicNetworkAccess"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AcrConfigurationLoginServer"))) + { + this.AcrConfigurationLoginServer = (string[])(this.MyInvocation?.BoundParameters["AcrConfigurationLoginServer"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AcrConfigurationOciArtifact"))) + { + this.AcrConfigurationOciArtifact = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[])(this.MyInvocation?.BoundParameters["AcrConfigurationOciArtifact"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Authority"))) + { + this.Authority = (string)(this.MyInvocation?.BoundParameters["Authority"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Audience"))) + { + this.Audience = (string)(this.MyInvocation?.BoundParameters["Audience"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("EnableSmartProxy"))) + { + this.EnableSmartProxy = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["EnableSmartProxy"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("CorsOrigin"))) + { + this.CorsOrigin = (string[])(this.MyInvocation?.BoundParameters["CorsOrigin"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("CorsHeader"))) + { + this.CorsHeader = (string[])(this.MyInvocation?.BoundParameters["CorsHeader"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("CorsMethod"))) + { + this.CorsMethod = (string[])(this.MyInvocation?.BoundParameters["CorsMethod"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("CorsMaxAge"))) + { + this.CorsMaxAge = (int)(this.MyInvocation?.BoundParameters["CorsMaxAge"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AllowCorsCredential"))) + { + this.AllowCorsCredential = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["AllowCorsCredential"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExportStorageAccountName"))) + { + this.ExportStorageAccountName = (string)(this.MyInvocation?.BoundParameters["ExportStorageAccountName"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ResourceVersionPolicyConfigurationDefault"))) + { + this.ResourceVersionPolicyConfigurationDefault = (string)(this.MyInvocation?.BoundParameters["ResourceVersionPolicyConfigurationDefault"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ResourceVersionPolicyConfigurationResourceTypeOverride"))) + { + this.ResourceVersionPolicyConfigurationResourceTypeOverride = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides)(this.MyInvocation?.BoundParameters["ResourceVersionPolicyConfigurationResourceTypeOverride"]); + } + } + /// new protected void WriteObject(object sendToPipeline) { @@ -501,12 +854,12 @@ public UpdateAzHealthcareFhirService_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -523,15 +876,15 @@ public UpdateAzHealthcareFhirService_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, WorkspaceName=WorkspaceName, body=_fhirservicePatchResourceBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, WorkspaceName=WorkspaceName, body=_fhirservicePatchResourceBody }) + 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 } }); @@ -541,12 +894,12 @@ public UpdateAzHealthcareFhirService_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.HealthcareApis.Models.Api20211101.IFhirService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService /// 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 ) { @@ -558,8 +911,9 @@ public UpdateAzHealthcareFhirService_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareFhirService_UpdateViaIdentityExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareFhirService_UpdateViaIdentityExpanded.cs index 73102eb8e241..2ef271d0414c 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareFhirService_UpdateViaIdentityExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareFhirService_UpdateViaIdentityExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Patch FHIR Service details. + /// update a FHIR Service resource with the specified parameters. /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}" + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareFhirService_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader","IdentityType","IdentityUserAssignedIdentity"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","AccessPolicy","AcrConfigurationOciArtifact","CorConfigurationOrigin","CorConfigurationMethod","AcrConfigurationLoginServer","CorConfigurationHeader","IdentityType","IdentityUserAssignedIdentity"}, ChangeDescription="(1)The types of the properties 'PrivateEndpointConnection' and 'AuthenticationConfigurationAudience' will be changed from single object to 'List'. (2)IdentityType will be removed. EnableSystemAssignedIdentity will be used to enable/disable system assigned identity and UserAssignedIdentity will be used to specify user assigned identities.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Patch FHIR Service details.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update a FHIR Service resource with the specified parameters.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", ApiVersion = "2021-11-01")] public partial class UpdateAzHealthcareFhirService_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,22 +37,144 @@ public partial class UpdateAzHealthcareFhirService_UpdateViaIdentityExpanded : g /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// FhirService patch properties - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServicePatchResource _fhirservicePatchResourceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.FhirServicePatchResource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// The description of Fhir Service + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService _fhirserviceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirService(); + + /// Fhir Service access policies. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Fhir Service access policies.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fhir Service access policies.", + SerializedName = @"accessPolicies", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry[] AccessPolicyObjectId { get => _fhirserviceBody.AccessPolicy?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.AccessPolicy = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The list of the Azure container registry login servers. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of the Azure container registry login servers.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of the Azure container registry login servers.", + SerializedName = @"loginServers", + PossibleTypes = new [] { typeof(string) })] + public string[] AcrConfigurationLoginServer { get => _fhirserviceBody.AcrConfigurationLoginServer?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.AcrConfigurationLoginServer = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The list of Open Container Initiative (OCI) artifacts. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of Open Container Initiative (OCI) artifacts.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of Open Container Initiative (OCI) artifacts.", + SerializedName = @"ociArtifacts", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get => _fhirserviceBody.AcrConfigurationOciArtifact?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.AcrConfigurationOciArtifact = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// If credentials are allowed via CORS. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If credentials are allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If credentials are allowed via CORS.", + SerializedName = @"allowCredentials", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowCorsCredential { get => _fhirserviceBody.CorConfigurationAllowCredentials ?? default(global::System.Management.Automation.SwitchParameter); set => _fhirserviceBody.CorConfigurationAllowCredentials = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + /// The audience url for the service + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The audience url for the service")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The audience url for the service", + SerializedName = @"audience", + PossibleTypes = new [] { typeof(string) })] + public string Audience { get => _fhirserviceBody.AuthenticationConfigurationAudience ?? null; set => _fhirserviceBody.AuthenticationConfigurationAudience = value; } + + /// The authority url for the service + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The authority url for the service")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The authority url for the service", + SerializedName = @"authority", + PossibleTypes = new [] { typeof(string) })] + public string Authority { get => _fhirserviceBody.AuthenticationConfigurationAuthority ?? null; set => _fhirserviceBody.AuthenticationConfigurationAuthority = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; + /// The headers to be allowed via CORS. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The headers to be allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The headers to be allowed via CORS.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(string) })] + public string[] CorsHeader { get => _fhirserviceBody.CorConfigurationHeader?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.CorConfigurationHeader = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The max age to be allowed via CORS. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The max age to be allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The max age to be allowed via CORS.", + SerializedName = @"maxAge", + PossibleTypes = new [] { typeof(int) })] + public int CorsMaxAge { get => _fhirserviceBody.CorConfigurationMaxAge ?? default(int); set => _fhirserviceBody.CorConfigurationMaxAge = value; } + + /// The methods to be allowed via CORS. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The methods to be allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The methods to be allowed via CORS.", + SerializedName = @"methods", + PossibleTypes = new [] { typeof(string) })] + public string[] CorsMethod { get => _fhirserviceBody.CorConfigurationMethod?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.CorConfigurationMethod = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The origins to be allowed via CORS. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The origins to be allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The origins to be allowed via CORS.", + SerializedName = @"origins", + PossibleTypes = new [] { typeof(string) })] + public string[] CorsOrigin { get => _fhirserviceBody.CorConfigurationOrigin?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.CorConfigurationOrigin = (value != null ? new System.Collections.Generic.List(value) : null); } + /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet /// against a different subscription @@ -61,47 +185,59 @@ public partial class UpdateAzHealthcareFhirService_UpdateViaIdentityExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - /// SendAsync Pipeline Steps to be appended to the front of 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + /// If the SMART on FHIR proxy is enabled + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If the SMART on FHIR proxy is enabled")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If the SMART on FHIR proxy is enabled", + SerializedName = @"smartProxyEnabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableSmartProxy { get => _fhirserviceBody.AuthenticationConfigurationSmartProxyEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _fhirserviceBody.AuthenticationConfigurationSmartProxyEnabled = value; } - /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public System.Boolean? EnableSystemAssignedIdentity { get; set; } /// - /// Type of identity being specified, currently SystemAssigned and None are allowed. + /// An etag associated with the resource, used for optimistic concurrency when editing it. /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of identity being specified, currently SystemAssigned and None are allowed.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An etag associated with the resource, used for optimistic concurrency when editing it.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, - Description = @"Type of identity being specified, currently SystemAssigned and None are allowed.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType IdentityType { get => _fhirservicePatchResourceBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType)""); set => _fhirservicePatchResourceBody.IdentityType = value; } + Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _fhirserviceBody.Etag ?? null; set => _fhirserviceBody.Etag = value; } - /// - /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM - /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - /// The dictionary values can be empty objects ({}) in requests. - /// - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.")] + /// The name of the default export storage account. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the default export storage account.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, - Description = @"The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", - SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _fhirservicePatchResourceBody.IdentityUserAssignedIdentity ?? null /* object */; set => _fhirservicePatchResourceBody.IdentityUserAssignedIdentity = value; } + Description = @"The name of the default export storage account.", + SerializedName = @"storageAccountName", + PossibleTypes = new [] { typeof(string) })] + public string ExportStorageAccountName { get => _fhirserviceBody.ExportConfigurationStorageAccountName ?? null; set => _fhirserviceBody.ExportConfigurationStorageAccountName = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _inputObject; @@ -114,6 +250,18 @@ public partial class UpdateAzHealthcareFhirService_UpdateViaIdentityExpanded : g /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + /// The kind of the service. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The kind of the service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The kind of the service.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir-Stu3", "fhir-R4")] + public string Kind { get => _fhirserviceBody.Kind ?? null; set => _fhirserviceBody.Kind = value; } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -133,7 +281,7 @@ public partial class UpdateAzHealthcareFhirService_UpdateViaIdentityExpanded : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -151,6 +299,44 @@ public partial class UpdateAzHealthcareFhirService_UpdateViaIdentityExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + /// + /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Control permission for data plane traffic coming from public networks while private endpoint is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccess { get => _fhirserviceBody.PublicNetworkAccess ?? null; set => _fhirserviceBody.PublicNetworkAccess = value; } + + /// The default value for tracking history across all resources. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default value for tracking history across all resources.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value for tracking history across all resources.", + SerializedName = @"default", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("no-version", "versioned", "versioned-update")] + public string ResourceVersionPolicyConfigurationDefault { get => _fhirserviceBody.ResourceVersionPolicyConfigurationDefault ?? null; set => _fhirserviceBody.ResourceVersionPolicyConfigurationDefault = value; } + + /// A list of FHIR Resources and their version policy overrides. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A list of FHIR Resources and their version policy overrides.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of FHIR Resources and their version policy overrides.", + SerializedName = @"resourceTypeOverrides", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceVersionPolicyConfigurationResourceTypeOverride { get => _fhirserviceBody.ResourceVersionPolicyConfigurationResourceTypeOverride ?? null /* object */; set => _fhirserviceBody.ResourceVersionPolicyConfigurationResourceTypeOverride = value; } + /// Resource tags. [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] @@ -160,32 +346,40 @@ public partial class UpdateAzHealthcareFhirService_UpdateViaIdentityExpanded : g ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => _fhirservicePatchResourceBody.Tag ?? null /* object */; set => _fhirservicePatchResourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => _fhirserviceBody.Tag ?? null /* object */; set => _fhirserviceBody.Tag = value; } + + /// + /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in + /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] + [global::System.Management.Automation.AllowEmptyCollection] + public string[] UserAssignedIdentity { 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IFhirService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService /// 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) @@ -222,7 +416,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthc clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone._fhirservicePatchResourceBody = this._fhirservicePatchResourceBody; + clone._fhirserviceBody = this._fhirserviceBody; return clone; } @@ -293,11 +487,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -309,10 +528,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -321,6 +556,44 @@ protected override void EndProcessing() } } + private void PreProcessManagedIdentityParametersWithGetResult() + { + bool supportsSystemAssignedIdentity = (true == this.EnableSystemAssignedIdentity || null == this.EnableSystemAssignedIdentity && true == _fhirserviceBody?.IdentityType?.Contains("SystemAssigned")); + bool supportsUserAssignedIdentity = false; + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _fhirserviceBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _fhirserviceBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentity()); + } + } + supportsUserAssignedIdentity = true == this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && this.UserAssignedIdentity?.Length > 0 || + true != this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && true == _fhirserviceBody.IdentityType?.Contains("UserAssigned"); + if (!supportsUserAssignedIdentity) + { + _fhirserviceBody.IdentityUserAssignedIdentity = null; + } + // calculate IdentityType + if ((supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _fhirserviceBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else if ((supportsUserAssignedIdentity && !supportsSystemAssignedIdentity)) + { + _fhirserviceBody.IdentityType = "UserAssigned"; + } + else if ((!supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _fhirserviceBody.IdentityType = "SystemAssigned"; + } + else + { + _fhirserviceBody.IdentityType = "None"; + } + } + /// Performs execution of the command. protected override void ProcessRecord() { @@ -329,7 +602,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'FhirServicesUpdate' operation")) + if (ShouldProcess($"Call remote 'FhirServicesCreateOrUpdate' operation")) { if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { @@ -380,7 +653,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -395,34 +668,40 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.FhirServicesUpdateViaIdentity(InputObject.Id, _fhirservicePatchResourceBody, onOk, onDefault, this, Pipeline); + _fhirserviceBody = await this.Client.FhirServicesGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_fhirserviceBody(); + await this.Client.FhirServicesCreateOrUpdateViaIdentity(InputObject.Id, _fhirserviceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); } else { // try to call with PATH parameters from Input Object - 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.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.FhirServiceName) + if (null == InputObject.ResourceGroupName) { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FhirServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + 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.WorkspaceName) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.FhirServicesUpdate(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.FhirServiceName ?? null, InputObject.WorkspaceName ?? null, _fhirservicePatchResourceBody, onOk, onDefault, this, Pipeline); + if (null == InputObject.FhirServiceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FhirServiceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _fhirserviceBody = await this.Client.FhirServicesGetWithResult(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WorkspaceName ?? null, InputObject.FhirServiceName ?? null, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_fhirserviceBody(); + await this.Client.FhirServicesCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WorkspaceName ?? null, InputObject.FhirServiceName ?? null, _fhirserviceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_fhirservicePatchResourceBody}) + 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 } }); @@ -442,13 +721,89 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzHealthcareFhirService_UpdateViaIdentityExpanded() { } + private void Update_fhirserviceBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) + { + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Etag"))) + { + this.Etag = (string)(this.MyInvocation?.BoundParameters["Etag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Kind"))) + { + this.Kind = (string)(this.MyInvocation?.BoundParameters["Kind"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AccessPolicyObjectId"))) + { + this.AccessPolicyObjectId = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry[])(this.MyInvocation?.BoundParameters["AccessPolicyObjectId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PublicNetworkAccess"))) + { + this.PublicNetworkAccess = (string)(this.MyInvocation?.BoundParameters["PublicNetworkAccess"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AcrConfigurationLoginServer"))) + { + this.AcrConfigurationLoginServer = (string[])(this.MyInvocation?.BoundParameters["AcrConfigurationLoginServer"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AcrConfigurationOciArtifact"))) + { + this.AcrConfigurationOciArtifact = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[])(this.MyInvocation?.BoundParameters["AcrConfigurationOciArtifact"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Authority"))) + { + this.Authority = (string)(this.MyInvocation?.BoundParameters["Authority"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Audience"))) + { + this.Audience = (string)(this.MyInvocation?.BoundParameters["Audience"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("EnableSmartProxy"))) + { + this.EnableSmartProxy = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["EnableSmartProxy"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("CorsOrigin"))) + { + this.CorsOrigin = (string[])(this.MyInvocation?.BoundParameters["CorsOrigin"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("CorsHeader"))) + { + this.CorsHeader = (string[])(this.MyInvocation?.BoundParameters["CorsHeader"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("CorsMethod"))) + { + this.CorsMethod = (string[])(this.MyInvocation?.BoundParameters["CorsMethod"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("CorsMaxAge"))) + { + this.CorsMaxAge = (int)(this.MyInvocation?.BoundParameters["CorsMaxAge"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AllowCorsCredential"))) + { + this.AllowCorsCredential = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["AllowCorsCredential"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExportStorageAccountName"))) + { + this.ExportStorageAccountName = (string)(this.MyInvocation?.BoundParameters["ExportStorageAccountName"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ResourceVersionPolicyConfigurationDefault"))) + { + this.ResourceVersionPolicyConfigurationDefault = (string)(this.MyInvocation?.BoundParameters["ResourceVersionPolicyConfigurationDefault"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ResourceVersionPolicyConfigurationResourceTypeOverride"))) + { + this.ResourceVersionPolicyConfigurationResourceTypeOverride = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides)(this.MyInvocation?.BoundParameters["ResourceVersionPolicyConfigurationResourceTypeOverride"]); + } + } + /// new protected void WriteObject(object sendToPipeline) { @@ -468,12 +823,12 @@ public UpdateAzHealthcareFhirService_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -490,15 +845,15 @@ public UpdateAzHealthcareFhirService_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_fhirservicePatchResourceBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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=_fhirservicePatchResourceBody }) + 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 } }); @@ -508,12 +863,12 @@ public UpdateAzHealthcareFhirService_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.HealthcareApis.Models.Api20211101.IFhirService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService /// 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 ) { @@ -525,8 +880,9 @@ public UpdateAzHealthcareFhirService_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareFhirService_UpdateViaIdentityWorkspaceExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareFhirService_UpdateViaIdentityWorkspaceExpanded.cs new file mode 100644 index 000000000000..cd63c898db6e --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareFhirService_UpdateViaIdentityWorkspaceExpanded.cs @@ -0,0 +1,905 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// update a FHIR Service resource with the specified parameters. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareFhirService_UpdateViaIdentityWorkspaceExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update a FHIR Service resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + public partial class UpdateAzHealthcareFhirService_UpdateViaIdentityWorkspaceExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// The description of Fhir Service + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService _fhirserviceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.FhirService(); + + /// Fhir Service access policies. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Fhir Service access policies.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fhir Service access policies.", + SerializedName = @"accessPolicies", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry[] AccessPolicyObjectId { get => _fhirserviceBody.AccessPolicy?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.AccessPolicy = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The list of the Azure container registry login servers. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of the Azure container registry login servers.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of the Azure container registry login servers.", + SerializedName = @"loginServers", + PossibleTypes = new [] { typeof(string) })] + public string[] AcrConfigurationLoginServer { get => _fhirserviceBody.AcrConfigurationLoginServer?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.AcrConfigurationLoginServer = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The list of Open Container Initiative (OCI) artifacts. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of Open Container Initiative (OCI) artifacts.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of Open Container Initiative (OCI) artifacts.", + SerializedName = @"ociArtifacts", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[] AcrConfigurationOciArtifact { get => _fhirserviceBody.AcrConfigurationOciArtifact?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.AcrConfigurationOciArtifact = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// If credentials are allowed via CORS. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If credentials are allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If credentials are allowed via CORS.", + SerializedName = @"allowCredentials", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowCorsCredential { get => _fhirserviceBody.CorConfigurationAllowCredentials ?? default(global::System.Management.Automation.SwitchParameter); set => _fhirserviceBody.CorConfigurationAllowCredentials = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// The audience url for the service + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The audience url for the service")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The audience url for the service", + SerializedName = @"audience", + PossibleTypes = new [] { typeof(string) })] + public string Audience { get => _fhirserviceBody.AuthenticationConfigurationAudience ?? null; set => _fhirserviceBody.AuthenticationConfigurationAudience = value; } + + /// The authority url for the service + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The authority url for the service")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The authority url for the service", + SerializedName = @"authority", + PossibleTypes = new [] { typeof(string) })] + public string Authority { get => _fhirserviceBody.AuthenticationConfigurationAuthority ?? null; set => _fhirserviceBody.AuthenticationConfigurationAuthority = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; + + /// The headers to be allowed via CORS. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The headers to be allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The headers to be allowed via CORS.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(string) })] + public string[] CorsHeader { get => _fhirserviceBody.CorConfigurationHeader?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.CorConfigurationHeader = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The max age to be allowed via CORS. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The max age to be allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The max age to be allowed via CORS.", + SerializedName = @"maxAge", + PossibleTypes = new [] { typeof(int) })] + public int CorsMaxAge { get => _fhirserviceBody.CorConfigurationMaxAge ?? default(int); set => _fhirserviceBody.CorConfigurationMaxAge = value; } + + /// The methods to be allowed via CORS. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The methods to be allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The methods to be allowed via CORS.", + SerializedName = @"methods", + PossibleTypes = new [] { typeof(string) })] + public string[] CorsMethod { get => _fhirserviceBody.CorConfigurationMethod?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.CorConfigurationMethod = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The origins to be allowed via CORS. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The origins to be allowed via CORS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The origins to be allowed via CORS.", + SerializedName = @"origins", + PossibleTypes = new [] { typeof(string) })] + public string[] CorsOrigin { get => _fhirserviceBody.CorConfigurationOrigin?.ToArray() ?? null /* fixedArrayOf */; set => _fhirserviceBody.CorConfigurationOrigin = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// If the SMART on FHIR proxy is enabled + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If the SMART on FHIR proxy is enabled")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If the SMART on FHIR proxy is enabled", + SerializedName = @"smartProxyEnabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableSmartProxy { get => _fhirserviceBody.AuthenticationConfigurationSmartProxyEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _fhirserviceBody.AuthenticationConfigurationSmartProxyEnabled = value; } + + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public System.Boolean? EnableSystemAssignedIdentity { get; set; } + + /// + /// An etag associated with the resource, used for optimistic concurrency when editing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An etag associated with the resource, used for optimistic concurrency when editing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _fhirserviceBody.Etag ?? null; set => _fhirserviceBody.Etag = value; } + + /// The name of the default export storage account. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the default export storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the default export storage account.", + SerializedName = @"storageAccountName", + PossibleTypes = new [] { typeof(string) })] + public string ExportStorageAccountName { get => _fhirserviceBody.ExportConfigurationStorageAccountName ?? null; set => _fhirserviceBody.ExportConfigurationStorageAccountName = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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; } } + + /// The kind of the service. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The kind of the service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The kind of the service.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir-Stu3", "fhir-R4")] + public string Kind { get => _fhirserviceBody.Kind ?? null; set => _fhirserviceBody.Kind = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of FHIR Service resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of FHIR Service resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of FHIR Service resource.", + SerializedName = @"fhirServiceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("FhirServiceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Control permission for data plane traffic coming from public networks while private endpoint is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Control permission for data plane traffic coming from public networks while private endpoint is enabled.", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccess { get => _fhirserviceBody.PublicNetworkAccess ?? null; set => _fhirserviceBody.PublicNetworkAccess = value; } + + /// The default value for tracking history across all resources. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default value for tracking history across all resources.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value for tracking history across all resources.", + SerializedName = @"default", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("no-version", "versioned", "versioned-update")] + public string ResourceVersionPolicyConfigurationDefault { get => _fhirserviceBody.ResourceVersionPolicyConfigurationDefault ?? null; set => _fhirserviceBody.ResourceVersionPolicyConfigurationDefault = value; } + + /// A list of FHIR Resources and their version policy overrides. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A list of FHIR Resources and their version policy overrides.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of FHIR Resources and their version policy overrides.", + SerializedName = @"resourceTypeOverrides", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides ResourceVersionPolicyConfigurationResourceTypeOverride { get => _fhirserviceBody.ResourceVersionPolicyConfigurationResourceTypeOverride ?? null /* object */; set => _fhirserviceBody.ResourceVersionPolicyConfigurationResourceTypeOverride = value; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => _fhirserviceBody.Tag ?? null /* object */; set => _fhirserviceBody.Tag = value; } + + /// + /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in + /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] + [global::System.Management.Automation.AllowEmptyCollection] + public string[] UserAssignedIdentity { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _workspaceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity WorkspaceInputObject { get => this._workspaceInputObject; set => this._workspaceInputObject = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IFhirService + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzHealthcareFhirService_UpdateViaIdentityWorkspaceExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthcareFhirService_UpdateViaIdentityWorkspaceExpanded Clone() + { + var clone = new UpdateAzHealthcareFhirService_UpdateViaIdentityWorkspaceExpanded(); + 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._fhirserviceBody = this._fhirserviceBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + private void PreProcessManagedIdentityParametersWithGetResult() + { + bool supportsSystemAssignedIdentity = (true == this.EnableSystemAssignedIdentity || null == this.EnableSystemAssignedIdentity && true == _fhirserviceBody?.IdentityType?.Contains("SystemAssigned")); + bool supportsUserAssignedIdentity = false; + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _fhirserviceBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _fhirserviceBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentity()); + } + } + supportsUserAssignedIdentity = true == this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && this.UserAssignedIdentity?.Length > 0 || + true != this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && true == _fhirserviceBody.IdentityType?.Contains("UserAssigned"); + if (!supportsUserAssignedIdentity) + { + _fhirserviceBody.IdentityUserAssignedIdentity = null; + } + // calculate IdentityType + if ((supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _fhirserviceBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else if ((supportsUserAssignedIdentity && !supportsSystemAssignedIdentity)) + { + _fhirserviceBody.IdentityType = "UserAssigned"; + } + else if ((!supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _fhirserviceBody.IdentityType = "SystemAssigned"; + } + else + { + _fhirserviceBody.IdentityType = "None"; + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FhirServicesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (WorkspaceInputObject?.Id != null) + { + this.WorkspaceInputObject.Id += $"/fhirservices/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + _fhirserviceBody = await this.Client.FhirServicesGetViaIdentityWithResult(WorkspaceInputObject.Id, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_fhirserviceBody(); + await this.Client.FhirServicesCreateOrUpdateViaIdentity(WorkspaceInputObject.Id, _fhirserviceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == WorkspaceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + _fhirserviceBody = await this.Client.FhirServicesGetWithResult(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, Name, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_fhirserviceBody(); + await this.Client.FhirServicesCreateOrUpdate(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, Name, _fhirserviceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzHealthcareFhirService_UpdateViaIdentityWorkspaceExpanded() + { + + } + + private void Update_fhirserviceBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) + { + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Etag"))) + { + this.Etag = (string)(this.MyInvocation?.BoundParameters["Etag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Kind"))) + { + this.Kind = (string)(this.MyInvocation?.BoundParameters["Kind"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AccessPolicyObjectId"))) + { + this.AccessPolicyObjectId = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry[])(this.MyInvocation?.BoundParameters["AccessPolicyObjectId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PublicNetworkAccess"))) + { + this.PublicNetworkAccess = (string)(this.MyInvocation?.BoundParameters["PublicNetworkAccess"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AcrConfigurationLoginServer"))) + { + this.AcrConfigurationLoginServer = (string[])(this.MyInvocation?.BoundParameters["AcrConfigurationLoginServer"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AcrConfigurationOciArtifact"))) + { + this.AcrConfigurationOciArtifact = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[])(this.MyInvocation?.BoundParameters["AcrConfigurationOciArtifact"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Authority"))) + { + this.Authority = (string)(this.MyInvocation?.BoundParameters["Authority"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Audience"))) + { + this.Audience = (string)(this.MyInvocation?.BoundParameters["Audience"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("EnableSmartProxy"))) + { + this.EnableSmartProxy = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["EnableSmartProxy"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("CorsOrigin"))) + { + this.CorsOrigin = (string[])(this.MyInvocation?.BoundParameters["CorsOrigin"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("CorsHeader"))) + { + this.CorsHeader = (string[])(this.MyInvocation?.BoundParameters["CorsHeader"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("CorsMethod"))) + { + this.CorsMethod = (string[])(this.MyInvocation?.BoundParameters["CorsMethod"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("CorsMaxAge"))) + { + this.CorsMaxAge = (int)(this.MyInvocation?.BoundParameters["CorsMaxAge"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AllowCorsCredential"))) + { + this.AllowCorsCredential = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["AllowCorsCredential"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExportStorageAccountName"))) + { + this.ExportStorageAccountName = (string)(this.MyInvocation?.BoundParameters["ExportStorageAccountName"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ResourceVersionPolicyConfigurationDefault"))) + { + this.ResourceVersionPolicyConfigurationDefault = (string)(this.MyInvocation?.BoundParameters["ResourceVersionPolicyConfigurationDefault"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ResourceVersionPolicyConfigurationResourceTypeOverride"))) + { + this.ResourceVersionPolicyConfigurationResourceTypeOverride = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides)(this.MyInvocation?.BoundParameters["ResourceVersionPolicyConfigurationResourceTypeOverride"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IFhirService + /// 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.HealthcareApis.Models.IFhirService + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnectorFhirDestination_UpdateExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnectorFhirDestination_UpdateExpanded.cs new file mode 100644 index 000000000000..d6daaac21cf7 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnectorFhirDestination_UpdateExpanded.cs @@ -0,0 +1,666 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// + /// update an IoT Connector FHIR destination resource with the specified parameters. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareIotConnectorFhirDestination_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update an IoT Connector FHIR destination resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + public partial class UpdateAzHealthcareIotConnectorFhirDestination_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// IoT Connector FHIR destination definition. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination _iotFhirDestinationBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestination(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// An etag associated with the resource, used for optimistic concurrency when editing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An etag associated with the resource, used for optimistic concurrency when editing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _iotFhirDestinationBody.Etag ?? null; set => _iotFhirDestinationBody.Etag = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// Backing field for property. + private string _fhirDestinationName; + + /// The name of IoT Connector FHIR destination resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector FHIR destination resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector FHIR destination resource.", + SerializedName = @"fhirDestinationName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string FhirDestinationName { get => this._fhirDestinationName; set => this._fhirDestinationName = value; } + + /// The mapping. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The mapping.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The mapping.", + SerializedName = @"content", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent FhirMappingContent { get => _iotFhirDestinationBody.FhirMappingContent ?? null /* object */; set => _iotFhirDestinationBody.FhirMappingContent = value; } + + /// Fully qualified resource id of the FHIR service to connect to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Fully qualified resource id of the FHIR service to connect to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified resource id of the FHIR service to connect to.", + SerializedName = @"fhirServiceResourceId", + PossibleTypes = new [] { typeof(string) })] + public string FhirServiceResourceId { get => _iotFhirDestinationBody.FhirServiceResourceId ?? null; set => _iotFhirDestinationBody.FhirServiceResourceId = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _iotConnectorName; + + /// The name of IoT Connector resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector resource.", + SerializedName = @"iotConnectorName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string IotConnectorName { get => this._iotConnectorName; set => this._iotConnectorName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group that contains the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group that contains the service instance.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Determines how resource identity is resolved on the destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines how resource identity is resolved on the destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines how resource identity is resolved on the destination.", + SerializedName = @"resourceIdentityResolutionType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Create", "Lookup")] + public string ResourceIdentityResolutionType { get => _iotFhirDestinationBody.ResourceIdentityResolutionType ?? null; set => _iotFhirDestinationBody.ResourceIdentityResolutionType = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _workspaceName; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string WorkspaceName { get => this._workspaceName; set => this._workspaceName = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzHealthcareIotConnectorFhirDestination_UpdateExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthcareIotConnectorFhirDestination_UpdateExpanded Clone() + { + var clone = new UpdateAzHealthcareIotConnectorFhirDestination_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._iotFhirDestinationBody = this._iotFhirDestinationBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.WorkspaceName = this.WorkspaceName; + clone.IotConnectorName = this.IotConnectorName; + clone.FhirDestinationName = this.FhirDestinationName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IotConnectorFhirDestinationCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + _iotFhirDestinationBody = await this.Client.IotConnectorFhirDestinationGetWithResult(SubscriptionId, ResourceGroupName, WorkspaceName, IotConnectorName, FhirDestinationName, this, Pipeline); + this.Update_iotFhirDestinationBody(); + await this.Client.IotConnectorFhirDestinationCreateOrUpdate(SubscriptionId, ResourceGroupName, WorkspaceName, IotConnectorName, FhirDestinationName, _iotFhirDestinationBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName,IotConnectorName=IotConnectorName,FhirDestinationName=FhirDestinationName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzHealthcareIotConnectorFhirDestination_UpdateExpanded() + { + + } + + private void Update_iotFhirDestinationBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Etag"))) + { + this.Etag = (string)(this.MyInvocation?.BoundParameters["Etag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ResourceIdentityResolutionType"))) + { + this.ResourceIdentityResolutionType = (string)(this.MyInvocation?.BoundParameters["ResourceIdentityResolutionType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("FhirServiceResourceId"))) + { + this.FhirServiceResourceId = (string)(this.MyInvocation?.BoundParameters["FhirServiceResourceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("FhirMappingContent"))) + { + this.FhirMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent)(this.MyInvocation?.BoundParameters["FhirMappingContent"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Models.IIotFhirDestination + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..c20db3c7546a --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityExpanded.cs @@ -0,0 +1,625 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// + /// update an IoT Connector FHIR destination resource with the specified parameters. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareIotConnectorFhirDestination_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update an IoT Connector FHIR destination resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + public partial class UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// IoT Connector FHIR destination definition. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination _iotFhirDestinationBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestination(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// An etag associated with the resource, used for optimistic concurrency when editing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An etag associated with the resource, used for optimistic concurrency when editing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _iotFhirDestinationBody.Etag ?? null; set => _iotFhirDestinationBody.Etag = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// The mapping. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The mapping.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The mapping.", + SerializedName = @"content", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent FhirMappingContent { get => _iotFhirDestinationBody.FhirMappingContent ?? null /* object */; set => _iotFhirDestinationBody.FhirMappingContent = value; } + + /// Fully qualified resource id of the FHIR service to connect to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Fully qualified resource id of the FHIR service to connect to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified resource id of the FHIR service to connect to.", + SerializedName = @"fhirServiceResourceId", + PossibleTypes = new [] { typeof(string) })] + public string FhirServiceResourceId { get => _iotFhirDestinationBody.FhirServiceResourceId ?? null; set => _iotFhirDestinationBody.FhirServiceResourceId = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity 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.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Determines how resource identity is resolved on the destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines how resource identity is resolved on the destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines how resource identity is resolved on the destination.", + SerializedName = @"resourceIdentityResolutionType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Create", "Lookup")] + public string ResourceIdentityResolutionType { get => _iotFhirDestinationBody.ResourceIdentityResolutionType ?? null; set => _iotFhirDestinationBody.ResourceIdentityResolutionType = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzHealthcareIotConnectorFhirDestination_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._iotFhirDestinationBody = this._iotFhirDestinationBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IotConnectorFhirDestinationCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + _iotFhirDestinationBody = await this.Client.IotConnectorFhirDestinationGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.Update_iotFhirDestinationBody(); + await this.Client.IotConnectorFhirDestinationCreateOrUpdateViaIdentity(InputObject.Id, _iotFhirDestinationBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); + } + 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.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.IotConnectorName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.IotConnectorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.FhirDestinationName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FhirDestinationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _iotFhirDestinationBody = await this.Client.IotConnectorFhirDestinationGetWithResult(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WorkspaceName ?? null, InputObject.IotConnectorName ?? null, InputObject.FhirDestinationName ?? null, this, Pipeline); + this.Update_iotFhirDestinationBody(); + await this.Client.IotConnectorFhirDestinationCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WorkspaceName ?? null, InputObject.IotConnectorName ?? null, InputObject.FhirDestinationName ?? null, _iotFhirDestinationBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityExpanded() + { + + } + + private void Update_iotFhirDestinationBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Etag"))) + { + this.Etag = (string)(this.MyInvocation?.BoundParameters["Etag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ResourceIdentityResolutionType"))) + { + this.ResourceIdentityResolutionType = (string)(this.MyInvocation?.BoundParameters["ResourceIdentityResolutionType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("FhirServiceResourceId"))) + { + this.FhirServiceResourceId = (string)(this.MyInvocation?.BoundParameters["FhirServiceResourceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("FhirMappingContent"))) + { + this.FhirMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent)(this.MyInvocation?.BoundParameters["FhirMappingContent"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Models.IIotFhirDestination + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityIotconnectorExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityIotconnectorExpanded.cs new file mode 100644 index 000000000000..85a563af523f --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityIotconnectorExpanded.cs @@ -0,0 +1,637 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// + /// update an IoT Connector FHIR destination resource with the specified parameters. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareIotConnectorFhirDestination_UpdateViaIdentityIotconnectorExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update an IoT Connector FHIR destination resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + public partial class UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityIotconnectorExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// IoT Connector FHIR destination definition. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination _iotFhirDestinationBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestination(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// An etag associated with the resource, used for optimistic concurrency when editing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An etag associated with the resource, used for optimistic concurrency when editing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _iotFhirDestinationBody.Etag ?? null; set => _iotFhirDestinationBody.Etag = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// Backing field for property. + private string _fhirDestinationName; + + /// The name of IoT Connector FHIR destination resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector FHIR destination resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector FHIR destination resource.", + SerializedName = @"fhirDestinationName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string FhirDestinationName { get => this._fhirDestinationName; set => this._fhirDestinationName = value; } + + /// The mapping. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The mapping.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The mapping.", + SerializedName = @"content", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent FhirMappingContent { get => _iotFhirDestinationBody.FhirMappingContent ?? null /* object */; set => _iotFhirDestinationBody.FhirMappingContent = value; } + + /// Fully qualified resource id of the FHIR service to connect to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Fully qualified resource id of the FHIR service to connect to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified resource id of the FHIR service to connect to.", + SerializedName = @"fhirServiceResourceId", + PossibleTypes = new [] { typeof(string) })] + public string FhirServiceResourceId { get => _iotFhirDestinationBody.FhirServiceResourceId ?? null; set => _iotFhirDestinationBody.FhirServiceResourceId = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _iotconnectorInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity IotconnectorInputObject { get => this._iotconnectorInputObject; set => this._iotconnectorInputObject = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Determines how resource identity is resolved on the destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines how resource identity is resolved on the destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines how resource identity is resolved on the destination.", + SerializedName = @"resourceIdentityResolutionType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Create", "Lookup")] + public string ResourceIdentityResolutionType { get => _iotFhirDestinationBody.ResourceIdentityResolutionType ?? null; set => _iotFhirDestinationBody.ResourceIdentityResolutionType = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityIotconnectorExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityIotconnectorExpanded Clone() + { + var clone = new UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityIotconnectorExpanded(); + 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._iotFhirDestinationBody = this._iotFhirDestinationBody; + clone.FhirDestinationName = this.FhirDestinationName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IotConnectorFhirDestinationCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (IotconnectorInputObject?.Id != null) + { + this.IotconnectorInputObject.Id += $"/fhirdestinations/{(global::System.Uri.EscapeDataString(this.FhirDestinationName.ToString()))}"; + _iotFhirDestinationBody = await this.Client.IotConnectorFhirDestinationGetViaIdentityWithResult(IotconnectorInputObject.Id, this, Pipeline); + this.Update_iotFhirDestinationBody(); + await this.Client.IotConnectorFhirDestinationCreateOrUpdateViaIdentity(IotconnectorInputObject.Id, _iotFhirDestinationBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == IotconnectorInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + if (null == IotconnectorInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + if (null == IotconnectorInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + if (null == IotconnectorInputObject.IotConnectorName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("IotconnectorInputObject has null value for IotconnectorInputObject.IotConnectorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, IotconnectorInputObject) ); + } + _iotFhirDestinationBody = await this.Client.IotConnectorFhirDestinationGetWithResult(IotconnectorInputObject.SubscriptionId ?? null, IotconnectorInputObject.ResourceGroupName ?? null, IotconnectorInputObject.WorkspaceName ?? null, IotconnectorInputObject.IotConnectorName ?? null, FhirDestinationName, this, Pipeline); + this.Update_iotFhirDestinationBody(); + await this.Client.IotConnectorFhirDestinationCreateOrUpdate(IotconnectorInputObject.SubscriptionId ?? null, IotconnectorInputObject.ResourceGroupName ?? null, IotconnectorInputObject.WorkspaceName ?? null, IotconnectorInputObject.IotConnectorName ?? null, FhirDestinationName, _iotFhirDestinationBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { FhirDestinationName=FhirDestinationName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityIotconnectorExpanded() + { + + } + + private void Update_iotFhirDestinationBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Etag"))) + { + this.Etag = (string)(this.MyInvocation?.BoundParameters["Etag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ResourceIdentityResolutionType"))) + { + this.ResourceIdentityResolutionType = (string)(this.MyInvocation?.BoundParameters["ResourceIdentityResolutionType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("FhirServiceResourceId"))) + { + this.FhirServiceResourceId = (string)(this.MyInvocation?.BoundParameters["FhirServiceResourceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("FhirMappingContent"))) + { + this.FhirMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent)(this.MyInvocation?.BoundParameters["FhirMappingContent"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Models.IIotFhirDestination + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityWorkspaceExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityWorkspaceExpanded.cs new file mode 100644 index 000000000000..923cfe5c0c79 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityWorkspaceExpanded.cs @@ -0,0 +1,648 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// + /// update an IoT Connector FHIR destination resource with the specified parameters. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareIotConnectorFhirDestination_UpdateViaIdentityWorkspaceExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update an IoT Connector FHIR destination resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + public partial class UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityWorkspaceExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// IoT Connector FHIR destination definition. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination _iotFhirDestinationBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotFhirDestination(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// An etag associated with the resource, used for optimistic concurrency when editing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An etag associated with the resource, used for optimistic concurrency when editing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _iotFhirDestinationBody.Etag ?? null; set => _iotFhirDestinationBody.Etag = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// Backing field for property. + private string _fhirDestinationName; + + /// The name of IoT Connector FHIR destination resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector FHIR destination resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector FHIR destination resource.", + SerializedName = @"fhirDestinationName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string FhirDestinationName { get => this._fhirDestinationName; set => this._fhirDestinationName = value; } + + /// The mapping. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The mapping.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The mapping.", + SerializedName = @"content", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent FhirMappingContent { get => _iotFhirDestinationBody.FhirMappingContent ?? null /* object */; set => _iotFhirDestinationBody.FhirMappingContent = value; } + + /// Fully qualified resource id of the FHIR service to connect to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Fully qualified resource id of the FHIR service to connect to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified resource id of the FHIR service to connect to.", + SerializedName = @"fhirServiceResourceId", + PossibleTypes = new [] { typeof(string) })] + public string FhirServiceResourceId { get => _iotFhirDestinationBody.FhirServiceResourceId ?? null; set => _iotFhirDestinationBody.FhirServiceResourceId = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _iotConnectorName; + + /// The name of IoT Connector resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector resource.", + SerializedName = @"iotConnectorName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string IotConnectorName { get => this._iotConnectorName; set => this._iotConnectorName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Determines how resource identity is resolved on the destination. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines how resource identity is resolved on the destination.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines how resource identity is resolved on the destination.", + SerializedName = @"resourceIdentityResolutionType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Create", "Lookup")] + public string ResourceIdentityResolutionType { get => _iotFhirDestinationBody.ResourceIdentityResolutionType ?? null; set => _iotFhirDestinationBody.ResourceIdentityResolutionType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _workspaceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity WorkspaceInputObject { get => this._workspaceInputObject; set => this._workspaceInputObject = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityWorkspaceExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityWorkspaceExpanded Clone() + { + var clone = new UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityWorkspaceExpanded(); + 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._iotFhirDestinationBody = this._iotFhirDestinationBody; + clone.IotConnectorName = this.IotConnectorName; + clone.FhirDestinationName = this.FhirDestinationName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IotConnectorFhirDestinationCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (WorkspaceInputObject?.Id != null) + { + this.WorkspaceInputObject.Id += $"/iotconnectors/{(global::System.Uri.EscapeDataString(this.IotConnectorName.ToString()))}/fhirdestinations/{(global::System.Uri.EscapeDataString(this.FhirDestinationName.ToString()))}"; + _iotFhirDestinationBody = await this.Client.IotConnectorFhirDestinationGetViaIdentityWithResult(WorkspaceInputObject.Id, this, Pipeline); + this.Update_iotFhirDestinationBody(); + await this.Client.IotConnectorFhirDestinationCreateOrUpdateViaIdentity(WorkspaceInputObject.Id, _iotFhirDestinationBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == WorkspaceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + _iotFhirDestinationBody = await this.Client.IotConnectorFhirDestinationGetWithResult(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, IotConnectorName, FhirDestinationName, this, Pipeline); + this.Update_iotFhirDestinationBody(); + await this.Client.IotConnectorFhirDestinationCreateOrUpdate(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, IotConnectorName, FhirDestinationName, _iotFhirDestinationBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IotConnectorName=IotConnectorName,FhirDestinationName=FhirDestinationName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzHealthcareIotConnectorFhirDestination_UpdateViaIdentityWorkspaceExpanded() + { + + } + + private void Update_iotFhirDestinationBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Etag"))) + { + this.Etag = (string)(this.MyInvocation?.BoundParameters["Etag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ResourceIdentityResolutionType"))) + { + this.ResourceIdentityResolutionType = (string)(this.MyInvocation?.BoundParameters["ResourceIdentityResolutionType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("FhirServiceResourceId"))) + { + this.FhirServiceResourceId = (string)(this.MyInvocation?.BoundParameters["FhirServiceResourceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("FhirMappingContent"))) + { + this.FhirMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent)(this.MyInvocation?.BoundParameters["FhirMappingContent"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IIotFhirDestination + /// 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.HealthcareApis.Models.IIotFhirDestination + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnector_UpdateExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnector_UpdateExpanded.cs index 8a7d57132aff..c6fa8407261b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnector_UpdateExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnector_UpdateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Patch an IoT Connector. + /// update an IoT Connector resource with the specified parameters. /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}" + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareIotConnector_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"IdentityType","IdentityUserAssignedIdentity"}, NewOutputProperties=new string[] {"EnableSystemAssignedIdentity","UserAssignedIdentity"}, ChangeDescription="IdentityType will be removed. EnableSystemAssignedIdentity will be used to enable/disable system assigned identity and UserAssignedIdentity will be used to specify user assigned identities.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Patch an IoT Connector.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update an IoT Connector resource with the specified parameters.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", ApiVersion = "2021-11-01")] public partial class UpdateAzHealthcareIotConnector_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +37,11 @@ public partial class UpdateAzHealthcareIotConnector_UpdateExpanded : global::Sys /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// Iot Connector patch properties - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPatchResource _iotConnectorPatchResourceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnectorPatchResource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// IoT Connector definition. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector _iotConnectorBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnector(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -48,6 +53,9 @@ public partial class UpdateAzHealthcareIotConnector_UpdateExpanded : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -61,6 +69,38 @@ public partial class UpdateAzHealthcareIotConnector_UpdateExpanded : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// The mapping. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The mapping.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The mapping.", + SerializedName = @"content", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent DeviceMappingContent { get => _iotConnectorBody.DeviceMappingContent ?? null /* object */; set => _iotConnectorBody.DeviceMappingContent = value; } + + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public System.Boolean? EnableSystemAssignedIdentity { get; set; } + + /// + /// An etag associated with the resource, used for optimistic concurrency when editing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An etag associated with the resource, used for optimistic concurrency when editing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _iotConnectorBody.Etag ?? null; set => _iotConnectorBody.Etag = 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] @@ -73,35 +113,38 @@ public partial class UpdateAzHealthcareIotConnector_UpdateExpanded : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// - /// Type of identity being specified, currently SystemAssigned and None are allowed. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of identity being specified, currently SystemAssigned and None are allowed.")] + /// Consumer group of the event hub to connected to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Consumer group of the event hub to connected to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Consumer group of the event hub to connected to.", + SerializedName = @"consumerGroup", + PossibleTypes = new [] { typeof(string) })] + public string IngestionEndpointConfigurationConsumerGroup { get => _iotConnectorBody.IngestionEndpointConfigurationConsumerGroup ?? null; set => _iotConnectorBody.IngestionEndpointConfigurationConsumerGroup = value; } + + /// Event Hub name to connect to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Event Hub name to connect to.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, - Description = @"Type of identity being specified, currently SystemAssigned and None are allowed.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType IdentityType { get => _iotConnectorPatchResourceBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType)""); set => _iotConnectorPatchResourceBody.IdentityType = value; } + Description = @"Event Hub name to connect to.", + SerializedName = @"eventHubName", + PossibleTypes = new [] { typeof(string) })] + public string IngestionEndpointConfigurationEventHubName { get => _iotConnectorBody.IngestionEndpointConfigurationEventHubName ?? null; set => _iotConnectorBody.IngestionEndpointConfigurationEventHubName = value; } - /// - /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM - /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - /// The dictionary values can be empty objects ({}) in requests. - /// - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.")] + /// Fully qualified namespace of the Event Hub to connect to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Fully qualified namespace of the Event Hub to connect to.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, - Description = @"The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", - SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _iotConnectorPatchResourceBody.IdentityUserAssignedIdentity ?? null /* object */; set => _iotConnectorPatchResourceBody.IdentityUserAssignedIdentity = value; } + Description = @"Fully qualified namespace of the Event Hub to connect to.", + SerializedName = @"fullyQualifiedEventHubNamespace", + PossibleTypes = new [] { typeof(string) })] + public string IngestionEndpointConfigurationFullyQualifiedEventHubNamespace { get => _iotConnectorBody.IngestionEndpointConfigurationFullyQualifiedEventHubNamespace ?? null; set => _iotConnectorBody.IngestionEndpointConfigurationFullyQualifiedEventHubNamespace = value; } /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -140,7 +183,7 @@ public partial class UpdateAzHealthcareIotConnector_UpdateExpanded : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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")] @@ -186,7 +229,8 @@ public partial class UpdateAzHealthcareIotConnector_UpdateExpanded : global::Sys [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -199,8 +243,16 @@ public partial class UpdateAzHealthcareIotConnector_UpdateExpanded : global::Sys ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => _iotConnectorPatchResourceBody.Tag ?? null /* object */; set => _iotConnectorPatchResourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => _iotConnectorBody.Tag ?? null /* object */; set => _iotConnectorBody.Tag = value; } + + /// + /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in + /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] + [global::System.Management.Automation.AllowEmptyCollection] + public string[] UserAssignedIdentity { get; set; } /// Backing field for property. private string _workspaceName; @@ -221,24 +273,24 @@ public partial class UpdateAzHealthcareIotConnector_UpdateExpanded : 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IIotConnector + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector /// 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,11 +327,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthc clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone._iotConnectorPatchResourceBody = this._iotConnectorPatchResourceBody; - clone.ResourceGroupName = this.ResourceGroupName; + clone._iotConnectorBody = this._iotConnectorBody; clone.SubscriptionId = this.SubscriptionId; - clone.Name = this.Name; + clone.ResourceGroupName = this.ResourceGroupName; clone.WorkspaceName = this.WorkspaceName; + clone.Name = this.Name; return clone; } @@ -350,11 +402,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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 +443,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -378,6 +471,44 @@ protected override void EndProcessing() } } + private void PreProcessManagedIdentityParametersWithGetResult() + { + bool supportsSystemAssignedIdentity = (true == this.EnableSystemAssignedIdentity || null == this.EnableSystemAssignedIdentity && true == _iotConnectorBody?.IdentityType?.Contains("SystemAssigned")); + bool supportsUserAssignedIdentity = false; + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _iotConnectorBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _iotConnectorBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentity()); + } + } + supportsUserAssignedIdentity = true == this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && this.UserAssignedIdentity?.Length > 0 || + true != this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && true == _iotConnectorBody.IdentityType?.Contains("UserAssigned"); + if (!supportsUserAssignedIdentity) + { + _iotConnectorBody.IdentityUserAssignedIdentity = null; + } + // calculate IdentityType + if ((supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _iotConnectorBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else if ((supportsUserAssignedIdentity && !supportsSystemAssignedIdentity)) + { + _iotConnectorBody.IdentityType = "UserAssigned"; + } + else if ((!supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _iotConnectorBody.IdentityType = "SystemAssigned"; + } + else + { + _iotConnectorBody.IdentityType = "None"; + } + } + /// Performs execution of the command. protected override void ProcessRecord() { @@ -386,7 +517,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'IotConnectorsUpdate' operation")) + if (ShouldProcess($"Call remote 'IotConnectorsCreateOrUpdate' operation")) { if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { @@ -437,7 +568,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -450,12 +581,15 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.IotConnectorsUpdate(ResourceGroupName, SubscriptionId, Name, WorkspaceName, _iotConnectorPatchResourceBody, onOk, onDefault, this, Pipeline); + _iotConnectorBody = await this.Client.IotConnectorsGetWithResult(SubscriptionId, ResourceGroupName, WorkspaceName, Name, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_iotConnectorBody(); + await this.Client.IotConnectorsCreateOrUpdate(SubscriptionId, ResourceGroupName, WorkspaceName, Name, _iotConnectorBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,WorkspaceName=WorkspaceName,body=_iotConnectorPatchResourceBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,WorkspaceName=WorkspaceName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -475,13 +609,41 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzHealthcareIotConnector_UpdateExpanded() { } + private void Update_iotConnectorBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) + { + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Etag"))) + { + this.Etag = (string)(this.MyInvocation?.BoundParameters["Etag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("IngestionEndpointConfigurationEventHubName"))) + { + this.IngestionEndpointConfigurationEventHubName = (string)(this.MyInvocation?.BoundParameters["IngestionEndpointConfigurationEventHubName"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("IngestionEndpointConfigurationConsumerGroup"))) + { + this.IngestionEndpointConfigurationConsumerGroup = (string)(this.MyInvocation?.BoundParameters["IngestionEndpointConfigurationConsumerGroup"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("IngestionEndpointConfigurationFullyQualifiedEventHubNamespace"))) + { + this.IngestionEndpointConfigurationFullyQualifiedEventHubNamespace = (string)(this.MyInvocation?.BoundParameters["IngestionEndpointConfigurationFullyQualifiedEventHubNamespace"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DeviceMappingContent"))) + { + this.DeviceMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent)(this.MyInvocation?.BoundParameters["DeviceMappingContent"]); + } + } + /// new protected void WriteObject(object sendToPipeline) { @@ -501,12 +663,12 @@ public UpdateAzHealthcareIotConnector_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -523,15 +685,15 @@ public UpdateAzHealthcareIotConnector_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, WorkspaceName=WorkspaceName, body=_iotConnectorPatchResourceBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, WorkspaceName=WorkspaceName, body=_iotConnectorPatchResourceBody }) + 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 } }); @@ -541,12 +703,12 @@ public UpdateAzHealthcareIotConnector_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.HealthcareApis.Models.Api20211101.IIotConnector + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector /// 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 ) { @@ -558,8 +720,9 @@ public UpdateAzHealthcareIotConnector_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnector_UpdateViaIdentityExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnector_UpdateViaIdentityExpanded.cs index bbae45ecb004..0c4d181ca82e 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnector_UpdateViaIdentityExpanded.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnector_UpdateViaIdentityExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; using System; - /// Patch an IoT Connector. + /// update an IoT Connector resource with the specified parameters. /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}" + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareIotConnector_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"IdentityType","IdentityUserAssignedIdentity"}, NewOutputProperties=new string[] {"EnableSystemAssignedIdentity","UserAssignedIdentity"}, ChangeDescription="IdentityType will be removed. EnableSystemAssignedIdentity will be used to enable/disable system assigned identity and UserAssignedIdentity will be used to specify user assigned identities.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector))] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"Patch an IoT Connector.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update an IoT Connector resource with the specified parameters.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", ApiVersion = "2021-11-01")] public partial class UpdateAzHealthcareIotConnector_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +37,11 @@ public partial class UpdateAzHealthcareIotConnector_UpdateViaIdentityExpanded : /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// Iot Connector patch properties - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnectorPatchResource _iotConnectorPatchResourceBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IotConnectorPatchResource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// IoT Connector definition. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector _iotConnectorBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnector(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -48,6 +53,9 @@ public partial class UpdateAzHealthcareIotConnector_UpdateViaIdentityExpanded : [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.ClientAPI; @@ -61,6 +69,38 @@ public partial class UpdateAzHealthcareIotConnector_UpdateViaIdentityExpanded : [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// The mapping. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The mapping.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The mapping.", + SerializedName = @"content", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent DeviceMappingContent { get => _iotConnectorBody.DeviceMappingContent ?? null /* object */; set => _iotConnectorBody.DeviceMappingContent = value; } + + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public System.Boolean? EnableSystemAssignedIdentity { get; set; } + + /// + /// An etag associated with the resource, used for optimistic concurrency when editing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An etag associated with the resource, used for optimistic concurrency when editing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _iotConnectorBody.Etag ?? null; set => _iotConnectorBody.Etag = 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] @@ -73,35 +113,38 @@ public partial class UpdateAzHealthcareIotConnector_UpdateViaIdentityExpanded : [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// - /// Type of identity being specified, currently SystemAssigned and None are allowed. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of identity being specified, currently SystemAssigned and None are allowed.")] + /// Consumer group of the event hub to connected to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Consumer group of the event hub to connected to.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, - Description = @"Type of identity being specified, currently SystemAssigned and None are allowed.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType IdentityType { get => _iotConnectorPatchResourceBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType)""); set => _iotConnectorPatchResourceBody.IdentityType = value; } + Description = @"Consumer group of the event hub to connected to.", + SerializedName = @"consumerGroup", + PossibleTypes = new [] { typeof(string) })] + public string IngestionEndpointConfigurationConsumerGroup { get => _iotConnectorBody.IngestionEndpointConfigurationConsumerGroup ?? null; set => _iotConnectorBody.IngestionEndpointConfigurationConsumerGroup = value; } - /// - /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM - /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - /// The dictionary values can be empty objects ({}) in requests. - /// - [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.")] + /// Event Hub name to connect to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Event Hub name to connect to.")] [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( Required = false, ReadOnly = false, - Description = @"The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", - SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _iotConnectorPatchResourceBody.IdentityUserAssignedIdentity ?? null /* object */; set => _iotConnectorPatchResourceBody.IdentityUserAssignedIdentity = value; } + Description = @"Event Hub name to connect to.", + SerializedName = @"eventHubName", + PossibleTypes = new [] { typeof(string) })] + public string IngestionEndpointConfigurationEventHubName { get => _iotConnectorBody.IngestionEndpointConfigurationEventHubName ?? null; set => _iotConnectorBody.IngestionEndpointConfigurationEventHubName = value; } + + /// Fully qualified namespace of the Event Hub to connect to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Fully qualified namespace of the Event Hub to connect to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified namespace of the Event Hub to connect to.", + SerializedName = @"fullyQualifiedEventHubNamespace", + PossibleTypes = new [] { typeof(string) })] + public string IngestionEndpointConfigurationFullyQualifiedEventHubNamespace { get => _iotConnectorBody.IngestionEndpointConfigurationFullyQualifiedEventHubNamespace ?? null; set => _iotConnectorBody.IngestionEndpointConfigurationFullyQualifiedEventHubNamespace = value; } /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _inputObject; @@ -133,7 +176,7 @@ public partial class UpdateAzHealthcareIotConnector_UpdateViaIdentityExpanded : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -160,32 +203,40 @@ public partial class UpdateAzHealthcareIotConnector_UpdateViaIdentityExpanded : ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags Tag { get => _iotConnectorPatchResourceBody.Tag ?? null /* object */; set => _iotConnectorPatchResourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => _iotConnectorBody.Tag ?? null /* object */; set => _iotConnectorBody.Tag = value; } + + /// + /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in + /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] + [global::System.Management.Automation.AllowEmptyCollection] + public string[] UserAssignedIdentity { 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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip 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.HealthcareApis.Models.Api20211101.IIotConnector + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector /// 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) @@ -224,7 +275,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthc clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone._iotConnectorPatchResourceBody = this._iotConnectorPatchResourceBody; + clone._iotConnectorBody = this._iotConnectorBody; return clone; } @@ -295,11 +346,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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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"); @@ -311,10 +387,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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -323,6 +415,44 @@ protected override void EndProcessing() } } + private void PreProcessManagedIdentityParametersWithGetResult() + { + bool supportsSystemAssignedIdentity = (true == this.EnableSystemAssignedIdentity || null == this.EnableSystemAssignedIdentity && true == _iotConnectorBody?.IdentityType?.Contains("SystemAssigned")); + bool supportsUserAssignedIdentity = false; + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _iotConnectorBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _iotConnectorBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentity()); + } + } + supportsUserAssignedIdentity = true == this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && this.UserAssignedIdentity?.Length > 0 || + true != this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && true == _iotConnectorBody.IdentityType?.Contains("UserAssigned"); + if (!supportsUserAssignedIdentity) + { + _iotConnectorBody.IdentityUserAssignedIdentity = null; + } + // calculate IdentityType + if ((supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _iotConnectorBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else if ((supportsUserAssignedIdentity && !supportsSystemAssignedIdentity)) + { + _iotConnectorBody.IdentityType = "UserAssigned"; + } + else if ((!supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _iotConnectorBody.IdentityType = "SystemAssigned"; + } + else + { + _iotConnectorBody.IdentityType = "None"; + } + } + /// Performs execution of the command. protected override void ProcessRecord() { @@ -331,7 +461,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'IotConnectorsUpdate' operation")) + if (ShouldProcess($"Call remote 'IotConnectorsCreateOrUpdate' operation")) { if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { @@ -382,7 +512,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -397,34 +527,40 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.IotConnectorsUpdateViaIdentity(InputObject.Id, _iotConnectorPatchResourceBody, onOk, onDefault, this, Pipeline); + _iotConnectorBody = await this.Client.IotConnectorsGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_iotConnectorBody(); + await this.Client.IotConnectorsCreateOrUpdateViaIdentity(InputObject.Id, _iotConnectorBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); } else { // try to call with PATH parameters from Input Object - 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.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.IotConnectorName) + if (null == InputObject.ResourceGroupName) { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.IotConnectorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + 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.WorkspaceName) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.IotConnectorsUpdate(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.IotConnectorName ?? null, InputObject.WorkspaceName ?? null, _iotConnectorPatchResourceBody, onOk, onDefault, this, Pipeline); + if (null == InputObject.IotConnectorName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.IotConnectorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _iotConnectorBody = await this.Client.IotConnectorsGetWithResult(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WorkspaceName ?? null, InputObject.IotConnectorName ?? null, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_iotConnectorBody(); + await this.Client.IotConnectorsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WorkspaceName ?? null, InputObject.IotConnectorName ?? null, _iotConnectorBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_iotConnectorPatchResourceBody}) + 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 } }); @@ -444,13 +580,41 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzHealthcareIotConnector_UpdateViaIdentityExpanded() { } + private void Update_iotConnectorBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) + { + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Etag"))) + { + this.Etag = (string)(this.MyInvocation?.BoundParameters["Etag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("IngestionEndpointConfigurationEventHubName"))) + { + this.IngestionEndpointConfigurationEventHubName = (string)(this.MyInvocation?.BoundParameters["IngestionEndpointConfigurationEventHubName"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("IngestionEndpointConfigurationConsumerGroup"))) + { + this.IngestionEndpointConfigurationConsumerGroup = (string)(this.MyInvocation?.BoundParameters["IngestionEndpointConfigurationConsumerGroup"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("IngestionEndpointConfigurationFullyQualifiedEventHubNamespace"))) + { + this.IngestionEndpointConfigurationFullyQualifiedEventHubNamespace = (string)(this.MyInvocation?.BoundParameters["IngestionEndpointConfigurationFullyQualifiedEventHubNamespace"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DeviceMappingContent"))) + { + this.DeviceMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent)(this.MyInvocation?.BoundParameters["DeviceMappingContent"]); + } + } + /// new protected void WriteObject(object sendToPipeline) { @@ -470,12 +634,12 @@ public UpdateAzHealthcareIotConnector_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.HealthcareApis.Models.Api20211101.IErrorDetails + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails /// from the remote call /// /// A that will be complete when handling of 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 ) { @@ -492,15 +656,15 @@ public UpdateAzHealthcareIotConnector_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_iotConnectorPatchResourceBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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=_iotConnectorPatchResourceBody }) + 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 } }); @@ -510,12 +674,12 @@ public UpdateAzHealthcareIotConnector_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.HealthcareApis.Models.Api20211101.IIotConnector + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector /// 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 ) { @@ -527,8 +691,9 @@ public UpdateAzHealthcareIotConnector_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnector_UpdateViaIdentityWorkspaceExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnector_UpdateViaIdentityWorkspaceExpanded.cs new file mode 100644 index 000000000000..25afe6c76819 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareIotConnector_UpdateViaIdentityWorkspaceExpanded.cs @@ -0,0 +1,714 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// update an IoT Connector resource with the specified parameters. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareIotConnector_UpdateViaIdentityWorkspaceExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update an IoT Connector resource with the specified parameters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + public partial class UpdateAzHealthcareIotConnector_UpdateViaIdentityWorkspaceExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// IoT Connector definition. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector _iotConnectorBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IotConnector(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The mapping. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The mapping.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The mapping.", + SerializedName = @"content", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent DeviceMappingContent { get => _iotConnectorBody.DeviceMappingContent ?? null /* object */; set => _iotConnectorBody.DeviceMappingContent = value; } + + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public System.Boolean? EnableSystemAssignedIdentity { get; set; } + + /// + /// An etag associated with the resource, used for optimistic concurrency when editing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An etag associated with the resource, used for optimistic concurrency when editing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An etag associated with the resource, used for optimistic concurrency when editing it.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _iotConnectorBody.Etag ?? null; set => _iotConnectorBody.Etag = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Consumer group of the event hub to connected to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Consumer group of the event hub to connected to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Consumer group of the event hub to connected to.", + SerializedName = @"consumerGroup", + PossibleTypes = new [] { typeof(string) })] + public string IngestionEndpointConfigurationConsumerGroup { get => _iotConnectorBody.IngestionEndpointConfigurationConsumerGroup ?? null; set => _iotConnectorBody.IngestionEndpointConfigurationConsumerGroup = value; } + + /// Event Hub name to connect to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Event Hub name to connect to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Event Hub name to connect to.", + SerializedName = @"eventHubName", + PossibleTypes = new [] { typeof(string) })] + public string IngestionEndpointConfigurationEventHubName { get => _iotConnectorBody.IngestionEndpointConfigurationEventHubName ?? null; set => _iotConnectorBody.IngestionEndpointConfigurationEventHubName = value; } + + /// Fully qualified namespace of the Event Hub to connect to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Fully qualified namespace of the Event Hub to connect to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified namespace of the Event Hub to connect to.", + SerializedName = @"fullyQualifiedEventHubNamespace", + PossibleTypes = new [] { typeof(string) })] + public string IngestionEndpointConfigurationFullyQualifiedEventHubNamespace { get => _iotConnectorBody.IngestionEndpointConfigurationFullyQualifiedEventHubNamespace ?? null; set => _iotConnectorBody.IngestionEndpointConfigurationFullyQualifiedEventHubNamespace = 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.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of IoT Connector resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of IoT Connector resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of IoT Connector resource.", + SerializedName = @"iotConnectorName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("IotConnectorName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags Tag { get => _iotConnectorBody.Tag ?? null /* object */; set => _iotConnectorBody.Tag = value; } + + /// + /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in + /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] + [global::System.Management.Automation.AllowEmptyCollection] + public string[] UserAssignedIdentity { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _workspaceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity WorkspaceInputObject { get => this._workspaceInputObject; set => this._workspaceInputObject = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IIotConnector + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzHealthcareIotConnector_UpdateViaIdentityWorkspaceExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthcareIotConnector_UpdateViaIdentityWorkspaceExpanded Clone() + { + var clone = new UpdateAzHealthcareIotConnector_UpdateViaIdentityWorkspaceExpanded(); + 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._iotConnectorBody = this._iotConnectorBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + private void PreProcessManagedIdentityParametersWithGetResult() + { + bool supportsSystemAssignedIdentity = (true == this.EnableSystemAssignedIdentity || null == this.EnableSystemAssignedIdentity && true == _iotConnectorBody?.IdentityType?.Contains("SystemAssigned")); + bool supportsUserAssignedIdentity = false; + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _iotConnectorBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _iotConnectorBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.UserAssignedIdentity()); + } + } + supportsUserAssignedIdentity = true == this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && this.UserAssignedIdentity?.Length > 0 || + true != this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && true == _iotConnectorBody.IdentityType?.Contains("UserAssigned"); + if (!supportsUserAssignedIdentity) + { + _iotConnectorBody.IdentityUserAssignedIdentity = null; + } + // calculate IdentityType + if ((supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _iotConnectorBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else if ((supportsUserAssignedIdentity && !supportsSystemAssignedIdentity)) + { + _iotConnectorBody.IdentityType = "UserAssigned"; + } + else if ((!supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _iotConnectorBody.IdentityType = "SystemAssigned"; + } + else + { + _iotConnectorBody.IdentityType = "None"; + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IotConnectorsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (WorkspaceInputObject?.Id != null) + { + this.WorkspaceInputObject.Id += $"/iotconnectors/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + _iotConnectorBody = await this.Client.IotConnectorsGetViaIdentityWithResult(WorkspaceInputObject.Id, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_iotConnectorBody(); + await this.Client.IotConnectorsCreateOrUpdateViaIdentity(WorkspaceInputObject.Id, _iotConnectorBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == WorkspaceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + _iotConnectorBody = await this.Client.IotConnectorsGetWithResult(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, Name, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_iotConnectorBody(); + await this.Client.IotConnectorsCreateOrUpdate(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, Name, _iotConnectorBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzHealthcareIotConnector_UpdateViaIdentityWorkspaceExpanded() + { + + } + + private void Update_iotConnectorBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) + { + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Etag"))) + { + this.Etag = (string)(this.MyInvocation?.BoundParameters["Etag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("IngestionEndpointConfigurationEventHubName"))) + { + this.IngestionEndpointConfigurationEventHubName = (string)(this.MyInvocation?.BoundParameters["IngestionEndpointConfigurationEventHubName"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("IngestionEndpointConfigurationConsumerGroup"))) + { + this.IngestionEndpointConfigurationConsumerGroup = (string)(this.MyInvocation?.BoundParameters["IngestionEndpointConfigurationConsumerGroup"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("IngestionEndpointConfigurationFullyQualifiedEventHubNamespace"))) + { + this.IngestionEndpointConfigurationFullyQualifiedEventHubNamespace = (string)(this.MyInvocation?.BoundParameters["IngestionEndpointConfigurationFullyQualifiedEventHubNamespace"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DeviceMappingContent"))) + { + this.DeviceMappingContent = (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent)(this.MyInvocation?.BoundParameters["DeviceMappingContent"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IIotConnector + /// 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.HealthcareApis.Models.IIotConnector + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateExpanded.cs new file mode 100644 index 000000000000..6b643fe215cf --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateExpanded.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.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// + /// update the state of the specified private endpoint connection associated with the workspace. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareWorkspacePrivateEndpointConnection_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update the state of the specified private endpoint connection associated with the workspace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + public partial class UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// The Private Endpoint Connection resource. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionDescription(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateEndpointConnectionName; + + /// The name of the private endpoint connection associated with the Azure resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private endpoint connection associated with the Azure resource")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the private endpoint connection associated with the Azure resource", + SerializedName = @"privateEndpointConnectionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string PrivateEndpointConnectionName { get => this._privateEndpointConnectionName; set => this._privateEndpointConnectionName = value; } + + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A message indicating if changes on the service provider require any updates on the consumer.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message indicating if changes on the service provider require any updates on the consumer.", + SerializedName = @"actionsRequired", + PossibleTypes = new [] { typeof(string) })] + public string PrivateLinkServiceConnectionStateActionsRequired { get => _propertiesBody.PrivateLinkServiceConnectionStateActionsRequired ?? null; set => _propertiesBody.PrivateLinkServiceConnectionStateActionsRequired = value; } + + /// The reason for approval/rejection of the connection. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The reason for approval/rejection of the connection.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reason for approval/rejection of the connection.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string PrivateLinkServiceConnectionStateDescription { get => _propertiesBody.PrivateLinkServiceConnectionStateDescription ?? null; set => _propertiesBody.PrivateLinkServiceConnectionStateDescription = value; } + + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + public string PrivateLinkServiceConnectionStateStatus { get => _propertiesBody.PrivateLinkServiceConnectionStateStatus ?? null; set => _propertiesBody.PrivateLinkServiceConnectionStateStatus = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group that contains the service instance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group that contains the service instance.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group that contains the service instance.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription identifier. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription identifier.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _workspaceName; + + /// The name of workspace resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of workspace resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of workspace resource.", + SerializedName = @"workspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string WorkspaceName { get => this._workspaceName; set => this._workspaceName = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IPrivateEndpointConnectionDescription + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateExpanded Clone() + { + var clone = new UpdateAzHealthcareWorkspacePrivateEndpointConnection_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._propertiesBody = this._propertiesBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.WorkspaceName = this.WorkspaceName; + clone.PrivateEndpointConnectionName = this.PrivateEndpointConnectionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkspacePrivateEndpointConnectionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + _propertiesBody = await this.Client.WorkspacePrivateEndpointConnectionsGetWithResult(SubscriptionId, ResourceGroupName, WorkspaceName, PrivateEndpointConnectionName, this, Pipeline); + this.Update_propertiesBody(); + await this.Client.WorkspacePrivateEndpointConnectionsCreateOrUpdate(SubscriptionId, ResourceGroupName, WorkspaceName, PrivateEndpointConnectionName, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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,WorkspaceName=WorkspaceName,PrivateEndpointConnectionName=PrivateEndpointConnectionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateExpanded() + { + + } + + private void Update_propertiesBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PrivateLinkServiceConnectionStateDescription"))) + { + this.PrivateLinkServiceConnectionStateDescription = (string)(this.MyInvocation?.BoundParameters["PrivateLinkServiceConnectionStateDescription"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PrivateLinkServiceConnectionStateActionsRequired"))) + { + this.PrivateLinkServiceConnectionStateActionsRequired = (string)(this.MyInvocation?.BoundParameters["PrivateLinkServiceConnectionStateActionsRequired"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PrivateLinkServiceConnectionStateStatus"))) + { + this.PrivateLinkServiceConnectionStateStatus = (string)(this.MyInvocation?.BoundParameters["PrivateLinkServiceConnectionStateStatus"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IPrivateEndpointConnectionDescription + /// 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.HealthcareApis.Models.IPrivateEndpointConnectionDescription + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..31a13b87c02c --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityExpanded.cs @@ -0,0 +1,608 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// + /// update the state of the specified private endpoint connection associated with the workspace. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update the state of the specified private endpoint connection associated with the workspace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + public partial class UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// The Private Endpoint Connection resource. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionDescription(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity 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.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A message indicating if changes on the service provider require any updates on the consumer.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message indicating if changes on the service provider require any updates on the consumer.", + SerializedName = @"actionsRequired", + PossibleTypes = new [] { typeof(string) })] + public string PrivateLinkServiceConnectionStateActionsRequired { get => _propertiesBody.PrivateLinkServiceConnectionStateActionsRequired ?? null; set => _propertiesBody.PrivateLinkServiceConnectionStateActionsRequired = value; } + + /// The reason for approval/rejection of the connection. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The reason for approval/rejection of the connection.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reason for approval/rejection of the connection.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string PrivateLinkServiceConnectionStateDescription { get => _propertiesBody.PrivateLinkServiceConnectionStateDescription ?? null; set => _propertiesBody.PrivateLinkServiceConnectionStateDescription = value; } + + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + public string PrivateLinkServiceConnectionStateStatus { get => _propertiesBody.PrivateLinkServiceConnectionStateStatus ?? null; set => _propertiesBody.PrivateLinkServiceConnectionStateStatus = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IPrivateEndpointConnectionDescription + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzHealthcareWorkspacePrivateEndpointConnection_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._propertiesBody = this._propertiesBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkspacePrivateEndpointConnectionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + _propertiesBody = await this.Client.WorkspacePrivateEndpointConnectionsGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.Update_propertiesBody(); + await this.Client.WorkspacePrivateEndpointConnectionsCreateOrUpdateViaIdentity(InputObject.Id, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); + } + 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.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PrivateEndpointConnectionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateEndpointConnectionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _propertiesBody = await this.Client.WorkspacePrivateEndpointConnectionsGetWithResult(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WorkspaceName ?? null, InputObject.PrivateEndpointConnectionName ?? null, this, Pipeline); + this.Update_propertiesBody(); + await this.Client.WorkspacePrivateEndpointConnectionsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WorkspaceName ?? null, InputObject.PrivateEndpointConnectionName ?? null, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityExpanded() + { + + } + + private void Update_propertiesBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PrivateLinkServiceConnectionStateDescription"))) + { + this.PrivateLinkServiceConnectionStateDescription = (string)(this.MyInvocation?.BoundParameters["PrivateLinkServiceConnectionStateDescription"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PrivateLinkServiceConnectionStateActionsRequired"))) + { + this.PrivateLinkServiceConnectionStateActionsRequired = (string)(this.MyInvocation?.BoundParameters["PrivateLinkServiceConnectionStateActionsRequired"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PrivateLinkServiceConnectionStateStatus"))) + { + this.PrivateLinkServiceConnectionStateStatus = (string)(this.MyInvocation?.BoundParameters["PrivateLinkServiceConnectionStateStatus"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IPrivateEndpointConnectionDescription + /// 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.HealthcareApis.Models.IPrivateEndpointConnectionDescription + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityWorkspaceExpanded.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityWorkspaceExpanded.cs new file mode 100644 index 000000000000..9fb3e272e440 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/cmdlets/UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityWorkspaceExpanded.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.HealthcareApis.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Cmdlets; + using System; + + /// + /// update the state of the specified private endpoint connection associated with the workspace. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityWorkspaceExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription))] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Description(@"update the state of the specified private endpoint connection associated with the workspace.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Generated] + public partial class UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityWorkspaceExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(); + + /// The Private Endpoint Connection resource. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.PrivateEndpointConnectionDescription(); + + /// 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.HealthcareApis Client => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateEndpointConnectionName; + + /// The name of the private endpoint connection associated with the Azure resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private endpoint connection associated with the Azure resource")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the private endpoint connection associated with the Azure resource", + SerializedName = @"privateEndpointConnectionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public string PrivateEndpointConnectionName { get => this._privateEndpointConnectionName; set => this._privateEndpointConnectionName = value; } + + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A message indicating if changes on the service provider require any updates on the consumer.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message indicating if changes on the service provider require any updates on the consumer.", + SerializedName = @"actionsRequired", + PossibleTypes = new [] { typeof(string) })] + public string PrivateLinkServiceConnectionStateActionsRequired { get => _propertiesBody.PrivateLinkServiceConnectionStateActionsRequired ?? null; set => _propertiesBody.PrivateLinkServiceConnectionStateActionsRequired = value; } + + /// The reason for approval/rejection of the connection. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The reason for approval/rejection of the connection.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reason for approval/rejection of the connection.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string PrivateLinkServiceConnectionStateDescription { get => _propertiesBody.PrivateLinkServiceConnectionStateDescription ?? null; set => _propertiesBody.PrivateLinkServiceConnectionStateDescription = value; } + + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + public string PrivateLinkServiceConnectionStateStatus { get => _propertiesBody.PrivateLinkServiceConnectionStateStatus ?? null; set => _propertiesBody.PrivateLinkServiceConnectionStateStatus = 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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity _workspaceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category(global::Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity WorkspaceInputObject { get => this._workspaceInputObject; set => this._workspaceInputObject = 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.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.HealthcareApis.Models.IPrivateEndpointConnectionDescription + /// 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.HealthcareApis.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityWorkspaceExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Cmdlets.UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityWorkspaceExpanded Clone() + { + var clone = new UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityWorkspaceExpanded(); + 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._propertiesBody = this._propertiesBody; + clone.PrivateEndpointConnectionName = this.PrivateEndpointConnectionName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.HealthcareApis.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.HealthcareApis.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.HealthcareApis.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkspacePrivateEndpointConnectionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (WorkspaceInputObject?.Id != null) + { + this.WorkspaceInputObject.Id += $"/privateEndpointConnections/{(global::System.Uri.EscapeDataString(this.PrivateEndpointConnectionName.ToString()))}"; + _propertiesBody = await this.Client.WorkspacePrivateEndpointConnectionsGetViaIdentityWithResult(WorkspaceInputObject.Id, this, Pipeline); + this.Update_propertiesBody(); + await this.Client.WorkspacePrivateEndpointConnectionsCreateOrUpdateViaIdentity(WorkspaceInputObject.Id, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == WorkspaceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + if (null == WorkspaceInputObject.WorkspaceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkspaceInputObject has null value for WorkspaceInputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkspaceInputObject) ); + } + _propertiesBody = await this.Client.WorkspacePrivateEndpointConnectionsGetWithResult(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, PrivateEndpointConnectionName, this, Pipeline); + this.Update_propertiesBody(); + await this.Client.WorkspacePrivateEndpointConnectionsCreateOrUpdate(WorkspaceInputObject.SubscriptionId ?? null, WorkspaceInputObject.ResourceGroupName ?? null, WorkspaceInputObject.WorkspaceName ?? null, PrivateEndpointConnectionName, _propertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { PrivateEndpointConnectionName=PrivateEndpointConnectionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityWorkspaceExpanded() + { + + } + + private void Update_propertiesBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PrivateLinkServiceConnectionStateDescription"))) + { + this.PrivateLinkServiceConnectionStateDescription = (string)(this.MyInvocation?.BoundParameters["PrivateLinkServiceConnectionStateDescription"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PrivateLinkServiceConnectionStateActionsRequired"))) + { + this.PrivateLinkServiceConnectionStateActionsRequired = (string)(this.MyInvocation?.BoundParameters["PrivateLinkServiceConnectionStateActionsRequired"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PrivateLinkServiceConnectionStateStatus"))) + { + this.PrivateLinkServiceConnectionStateStatus = (string)(this.MyInvocation?.BoundParameters["PrivateLinkServiceConnectionStateStatus"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IErrorDetails + /// from the remote call + /// + /// A that will be complete when handling of 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.HealthcareApis.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.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.HealthcareApis.Models.IPrivateEndpointConnectionDescription + /// 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.HealthcareApis.Models.IPrivateEndpointConnectionDescription + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..edf8eff052dd --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis +{ + using System; + using System.Collections.Generic; + using System.Text; + + [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)] + public class ExternalDocsAttribute : Attribute + { + + public string Description { get; } + + public string Url { get; } + + public ExternalDocsAttribute(string url) + { + Url = url; + } + + public ExternalDocsAttribute(string url, string description) + { + Url = url; + Description = description; + } + } +} diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..8b3fbef150b4 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis +{ + public class PSArgumentCompleterAttribute : ArgumentCompleterAttribute + { + internal string[] ResourceTypes; + + public PSArgumentCompleterAttribute(params string[] argumentList) : base(CreateScriptBlock(argumentList)) + { + ResourceTypes = argumentList; + } + + public static ScriptBlock CreateScriptBlock(string[] resourceTypes) + { + List outputResourceTypes = new List(); + foreach (string resourceType in resourceTypes) + { + if (resourceType.Contains(" ")) + { + outputResourceTypes.Add("\'\'" + resourceType + "\'\'"); + } + else + { + outputResourceTypes.Add(resourceType); + } + } + string scriptResourceTypeList = "'" + String.Join("' , '", outputResourceTypes) + "'"; + string script = "param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)\n" + + String.Format("$values = {0}\n", scriptResourceTypeList) + + "$values | Where-Object { $_ -Like \"$wordToComplete*\" -or $_ -Like \"'$wordToComplete*\" } | Sort-Object | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) }"; + ScriptBlock scriptBlock = ScriptBlock.Create(script); + return scriptBlock; + } + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index 3b97913cc7b6..fe165944b2d2 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; private const string PropertiesExcludedForTableview = @"Id,Type"; private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + private static string SelectedBySuffix = @"#Multiple"; + protected override void ProcessRecord() { try @@ -76,7 +78,7 @@ private static View CreateViewModel(ViewParameters viewParameters) Name = viewParameters.Type.FullName, ViewSelectedBy = new ViewSelectedBy { - TypeName = viewParameters.Type.FullName + TypeName = string.Concat(viewParameters.Type.FullName, SelectedBySuffix) }, TableControl = new TableControl { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index 41b9e7ffbb5c..3df48198f09e 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index 4826f98ee0a7..ff203f54c55f 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -70,9 +70,8 @@ protected override void ProcessRecord() var variantGroups = profileGroups.SelectMany(pg => pg.Variants .GroupBy(v => new { v.CmdletName, v.IsInternal }) .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), - Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) + Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) .ToArray(); - var license = new StringBuilder(); license.Append(@" # ---------------------------------------------------------------------------------- @@ -114,6 +113,7 @@ protected override void ProcessRecord() sb.Append("param("); sb.Append($"{(parameterGroups.Any() ? Environment.NewLine : String.Empty)}"); + foreach (var parameterGroup in parameterGroups) { var parameters = parameterGroup.HasAllVariants ? parameterGroup.Parameters.Take(1) : parameterGroup.Parameters; diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 76bb72265fbd..71d940e6ab59 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs @@ -137,7 +137,7 @@ protected override void ProcessRecord() } else { - var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().Append("*").ToPsList(); + var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().ToPsList(); sb.AppendLine($@"{Indent}FunctionsToExport = {cmdletsList}"); } @@ -148,8 +148,10 @@ protected override void ProcessRecord() } else { - var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().Append("*").ToPsList(); - sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().ToPsList(); + if (!String.IsNullOrEmpty(aliasesList)) { + sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + } } // CmdletsToExport diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index dfdb5d7b4a58..eba3329af33b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell { - [Cmdlet(VerbsData.Export, "TestStub")] - [DoNotExport] - public class ExportTestStub : PSCmdlet - { - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ModuleName { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ExportsFolder { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string OutputFolder { get; set; } - - [Parameter] - public SwitchParameter IncludeGenerated { get; set; } - - protected override void ProcessRecord() + [Cmdlet(VerbsData.Export, "TestStub")] + [DoNotExport] + public class ExportTestStub : PSCmdlet { - try - { - if (!Directory.Exists(ExportsFolder)) - { - throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); - } + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } - var exportDirectories = Directory.GetDirectories(ExportsFolder); - if (!exportDirectories.Any()) - { - exportDirectories = new[] { ExportsFolder }; - } - var utilFile = Path.Combine(OutputFolder, "utils.ps1"); - if (!File.Exists(utilFile)) + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeGenerated { get; set; } + + protected override void ProcessRecord() { - var sc = new StringBuilder(); - sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + /*var loadEnvFile = Path.Combine(OutputFolder, "loadEnv.ps1"); + if (!File.Exists(loadEnvFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@" +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json +}"); + File.WriteAllText(loadEnvFile, sc.ToString()); + }*/ + var utilFile = Path.Combine(OutputFolder, "utils.ps1"); + if (!File.Exists(utilFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { if ($allChars) { return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) } else { return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) } } +function Start-TestSleep { + [CmdletBinding(DefaultParameterSetName = 'SleepBySeconds')] + param( + [parameter(Mandatory = $true, Position = 0, ParameterSetName = 'SleepBySeconds')] + [ValidateRange(0.0, 2147483.0)] + [double] $Seconds, + + [parameter(Mandatory = $true, ParameterSetName = 'SleepByMilliseconds')] + [ValidateRange('NonNegative')] + [Alias('ms')] + [int] $Milliseconds + ) + + if ($TestMode -ne 'playback') { + switch ($PSCmdlet.ParameterSetName) { + 'SleepBySeconds' { + Start-Sleep -Seconds $Seconds + } + 'SleepByMilliseconds' { + Start-Sleep -Milliseconds $Milliseconds + } + } + } +} + $env = @{} if ($UsePreviousConfigForRecord) { $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json @@ -80,37 +126,40 @@ function cleanupEnv() { # Clean resources you create for testing } "); - File.WriteAllText(utilFile, sc.ToString()); - } - foreach (var exportDirectory in exportDirectories) - { - var outputFolder = OutputFolder; - if (exportDirectory != ExportsFolder) - { - outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); - Directory.CreateDirectory(outputFolder); - } - - var variantGroups = GetScriptCmdlets(exportDirectory) - .SelectMany(fi => fi.ToVariants()) - .Where(v => !v.IsDoNotExport) - .GroupBy(v => v.CmdletName) - .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) - .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); - - foreach (var variantGroup in variantGroups) - { - var sb = new StringBuilder(); - sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); - sb.AppendLine(@"{ + File.WriteAllText(utilFile, sc.ToString()); + } + + + + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var variantGroups = GetScriptCmdlets(exportDirectory) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .GroupBy(v => v.CmdletName) + .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) + .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); + + foreach (var variantGroup in variantGroups) + { + var sb = new StringBuilder(); + sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); + sb.AppendLine(@"{ $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' if (-Not (Test-Path -Path $loadEnvPath)) { $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' } . ($loadEnvPath)" -); - sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); - sb.AppendLine(@" $currentPath = $PSScriptRoot + ); + sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); + sb.AppendLine(@" $currentPath = $PSScriptRoot while(-not $mockingPath) { $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File $currentPath = Split-Path -Path $currentPath -Parent @@ -120,29 +169,29 @@ function cleanupEnv() { "); - sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); - var variants = variantGroup.Variants - .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) - .ToList(); + sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); + var variants = variantGroup.Variants + .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) + .ToList(); - foreach (var variant in variants) + foreach (var variant in variants) + { + sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); + sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); + var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; + sb.AppendLine($"{Indent}}}{variantSeparator}"); + } + sb.AppendLine("}"); + + File.WriteAllText(variantGroup.FilePath, sb.ToString()); + } + } + } + catch (Exception ee) { - sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); - sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); - var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; - sb.AppendLine($"{Indent}}}{variantSeparator}"); + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; } - sb.AppendLine("}"); - - File.WriteAllText(variantGroup.FilePath, sb.ToString()); - } } - } - catch (Exception ee) - { - Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); - throw ee; - } } - } } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index c023eaf1bf71..4aa91f1d0ed2 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs @@ -94,7 +94,7 @@ public static void WriteMarkdowns(IEnumerable variantGroups, PsMod sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); foreach (var relatedLink in markdownInfo.RelatedLinks) { - sb.Append($"{relatedLink}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"[{relatedLink}]({relatedLink}){Environment.NewLine}{Environment.NewLine}"); } File.WriteAllText(Path.Combine(docsFolder, $"{markdownInfo.CmdletName}.md"), sb.ToString()); diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs index 3af4d4264a99..743c3cb6899c 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs @@ -36,14 +36,23 @@ internal class PsHelpInfo public object Role { get; } public string NonTerminatingErrors { get; } + public static string CapitalizeFirstLetter(string text) + { + if (string.IsNullOrEmpty(text)) + return text; + + return char.ToUpper(text[0]) + text.Substring(1); + } + public PsHelpInfo(PSObject helpObject = null) { helpObject = helpObject ?? new PSObject(); CmdletName = helpObject.GetProperty("Name").NullIfEmpty() ?? helpObject.GetNestedProperty("details", "name"); ModuleName = helpObject.GetProperty("ModuleName"); - Synopsis = helpObject.GetProperty("Synopsis"); + Synopsis = CapitalizeFirstLetter(helpObject.GetProperty("Synopsis")); Description = helpObject.GetProperty("description").EmptyIfNull().ToDescriptionText().NullIfEmpty() ?? helpObject.GetNestedProperty("details", "description").EmptyIfNull().ToDescriptionText(); + Description = CapitalizeFirstLetter(Description); AlertText = helpObject.GetNestedProperty("alertSet", "alert").EmptyIfNull().ToDescriptionText(); Category = helpObject.GetProperty("Category"); HasCommonParameters = helpObject.GetProperty("CommonParameters").ToNullableBool(); diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index b5dae4e3956a..ef1f8a9452a4 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs @@ -31,7 +31,7 @@ internal class MarkdownHelpInfo public string[] Inputs { get; } public string[] Outputs { get; } public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } - public string[] RelatedLinks { get; } + public MarkdownRelatedLinkInfo[] RelatedLinks { get; } public bool SupportsShouldProcess { get; } public bool SupportsPaging { get; } @@ -67,7 +67,11 @@ public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string ComplexInterfaceInfos = variantGroup.ComplexInterfaceInfos; OnlineVersion = commentInfo.OnlineVersion; - RelatedLinks = commentInfo.RelatedLinks; + + var relatedLinkLists = new List(); + relatedLinkLists.AddRange(commentInfo.RelatedLinks?.Select(link => new MarkdownRelatedLinkInfo(link))); + relatedLinkLists.AddRange(variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Distinct()?.Select(link => new MarkdownRelatedLinkInfo(link.Url, link.Description))); + RelatedLinks = relatedLinkLists?.ToArray(); SupportsShouldProcess = variantGroup.SupportsShouldProcess; SupportsPaging = variantGroup.SupportsPaging; @@ -218,14 +222,45 @@ public MarkdownParameterHelpInfo(PsParameterHelpInfo[] parameterHelpInfos, Param } } + internal class MarkdownRelatedLinkInfo + { + public string Url { get; } + public string Description { get; } + + public MarkdownRelatedLinkInfo(string url) + { + Url = url; + } + + public MarkdownRelatedLinkInfo(string url, string description) + { + Url = url; + Description = description; + } + + public override string ToString() + { + if (string.IsNullOrEmpty(Description)) + { + return Url; + } + else + { + return $@"[{Description}]({Url})"; + + } + + } + } + internal static class MarkdownTypesExtensions { public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Output, exampleInfo.Remarks); public static MarkdownExampleHelpInfo[] DefaultExampleHelpInfos = { - new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), - new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here (remove the output block if the example doesn't have an output) }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here (remove the output block if the example doesn't have an output) }}}}", @"{{ Add description here }}"), }; public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters = diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 31108972da09..2a5734c79be5 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -121,6 +121,21 @@ public override string ToString() => CompleterInfo != null : String.Empty; } + internal class PSArgumentCompleterOutput : ArgumentCompleterOutput + { + public PSArgumentCompleterInfo PSArgumentCompleterInfo { get; } + + public PSArgumentCompleterOutput(PSArgumentCompleterInfo completerInfo) : base(completerInfo) + { + PSArgumentCompleterInfo = completerInfo; + } + + + public override string ToString() => PSArgumentCompleterInfo != null + ? $"{Indent}[{typeof(PSArgumentCompleterAttribute)}({(PSArgumentCompleterInfo.IsTypeCompleter ? $"[{PSArgumentCompleterInfo.Type.Unwrap().ToPsType()}]" : $"{PSArgumentCompleterInfo.ResourceTypes?.Select(r => $"\"{r}\"")?.JoinIgnoreEmpty(", ")}")})]{Environment.NewLine}" + : String.Empty; + } + internal class DefaultInfoOutput { public bool HasDefaultInfo { get; } @@ -173,6 +188,7 @@ internal class BaseOutput public VariantGroup VariantGroup { get; } protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) { VariantGroup = variantGroup; @@ -200,6 +216,21 @@ public string GetProcessCustomAttributesAtRuntime() {Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetLoginVerification() + { + if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + { + return $@" +{Indent}{Indent}$context = Get-AzContext +{Indent}{Indent}if (-not $context -and -not $testPlayback) {{ +{Indent}{Indent}{Indent}Write-Error ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" +{Indent}{Indent}{Indent}exit +{Indent}{Indent}}} +"; + } + return ""; + } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) @@ -232,10 +263,16 @@ public override string ToString() => $@"begin {{ {Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 {Indent}{Indent}}} {Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName -{GetTelemetry()} +{Indent}{Indent} +{Indent}{Indent}$testPlayback = $false +{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }} +{GetLoginVerification()}{GetTelemetry()} {GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} {GetProcessCustomAttributesAtRuntime()} {Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}if ($wrappedCmd -eq $null) {{ +{Indent}{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) +{Indent}{Indent}}} {Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} {Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) {Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) @@ -269,13 +306,16 @@ private string GetDefaultValuesStatements() var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); var parameterName = defaultInfo.ParameterGroup.ParameterName; sb.AppendLine(); + var setCondition = " "; + if (!String.IsNullOrEmpty(defaultInfo.SetCondition)) + { + setCondition = $" -and {defaultInfo.SetCondition}"; + } //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to //override default value set in required readme if ("SubscriptionId".Equals(parameterName)) { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); - sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); - sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); @@ -285,13 +325,15 @@ private string GetDefaultValuesStatements() } else { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); sb.Append($"{Indent}{Indent}}}"); } + } return sb.ToString(); } + } internal class ProcessOutput : BaseOutput @@ -381,6 +423,8 @@ public override string ToString() var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var externalUrls = String.Join(Environment.NewLine, CommentInfo.ExternalUrls.Select(l => $".Link{Environment.NewLine}{l}")); + var externalUrlsText = !String.IsNullOrEmpty(externalUrls) ? $"{Environment.NewLine}{externalUrls}" : String.Empty; var examples = ""; foreach (var example in VariantGroup.HelpInfo.Examples) { @@ -393,7 +437,7 @@ public override string ToString() {CommentInfo.Description.ToDescriptionFormat(false)} {examples}{inputsText}{outputsText}{notesText} .Link -{CommentInfo.OnlineVersion}{relatedLinksText} +{CommentInfo.OnlineVersion}{relatedLinksText}{externalUrlsText} #> "; } @@ -587,7 +631,9 @@ public static string ToSyntaxTypeName(this Type type) public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); - public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => (completerInfo is PSArgumentCompleterInfo psArgumentCompleterInfo) ? psArgumentCompleterInfo.ToArgumentCompleterOutput() : new ArgumentCompleterOutput(completerInfo); + + public static PSArgumentCompleterOutput ToArgumentCompleterOutput(this PSArgumentCompleterInfo completerInfo) => new PSArgumentCompleterOutput(completerInfo); public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index 0d5f90d8a22f..3a0fab363671 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -31,7 +31,7 @@ internal class VariantGroup { public string ModuleName { get; } - public string RootModuleName {get => @"";} + public string RootModuleName { get => @""; } public string CmdletName { get; } public string CmdletVerb { get; } public string CmdletNoun { get; } @@ -49,7 +49,7 @@ internal class VariantGroup public PsHelpInfo HelpInfo { get; } public bool IsGenerated { get; } public bool IsInternal { get; } - + public bool IsModelCmdlet { get; } public string OutputFolder { get; } public string FileName { get; } public string FilePath { get; } @@ -84,7 +84,7 @@ public VariantGroup(string moduleName, string cmdletName, Variant[] variants, st HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); IsInternal = isInternal; - + IsModelCmdlet = Variants.All(v => v.IsModelCmdlet); OutputFolder = outputFolder; FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; FilePath = Path.Combine(OutputFolder, FileName); @@ -101,12 +101,23 @@ private string DetermineDefaultParameterSetName() if (String.IsNullOrEmpty(defaultParameterSet)) { var variantParamCountGroups = Variants + .Where(v => !v.IsNotSuggestDefaultParameterSet) .Select(v => ( variant: v.VariantName, paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) .GroupBy(vpc => vpc.isSimple) .ToArray(); + if (variantParamCountGroups.Length == 0) + { + variantParamCountGroups = Variants + .Select(v => ( + variant: v.VariantName, + paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), + isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) + .GroupBy(vpc => vpc.isSimple) + .ToArray(); + } var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray(); var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount); defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant; @@ -134,7 +145,9 @@ internal class Variant public Parameter[] Parameters { get; } public Parameter[] CmdletOnlyParameters { get; } public bool IsInternal { get; } + public bool IsModelCmdlet { get; } public bool IsDoNotExport { get; } + public bool IsNotSuggestDefaultParameterSet { get; } public string[] Profiles { get; } public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) @@ -155,6 +168,8 @@ public Variant(string cmdletName, string variantName, CommandInfo info, CommandM Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); IsInternal = Attributes.OfType().Any(); IsDoNotExport = Attributes.OfType().Any(); + IsModelCmdlet = Attributes.OfType().Any(); + IsNotSuggestDefaultParameterSet = Attributes.OfType().Any(); CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray(); Profiles = Attributes.OfType().SelectMany(pa => pa.Profiles).ToArray(); } @@ -210,6 +225,7 @@ public ParameterGroup(string parameterName, Parameter[] parameters, string[] all HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo() + ?? Parameters.Select(p => p.PSArgumentCompleterAttribute).FirstOrDefault()?.ToPSArgumentCompleterInfo() ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); @@ -244,7 +260,6 @@ internal class Parameter public ParameterMetadata Metadata { get; } public PsParameterHelpInfo HelpInfo { get; } public Type ParameterType { get; } - public Attribute[] Attributes { get; } public ParameterCategory[] Categories { get; } public ParameterCategory OrderCategory { get; } @@ -254,6 +269,7 @@ internal class Parameter public bool SupportsWildcards { get; } public CompleterInfoAttribute CompleterInfoAttribute { get; } public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + public PSArgumentCompleterAttribute PSArgumentCompleterAttribute { get; } public bool ValueFromPipeline { get; } public bool ValueFromPipelineByPropertyName { get; } @@ -286,7 +302,8 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met } SupportsWildcards = Attributes.OfType().Any(); CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); - ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + PSArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(attr => !attr.GetType().Equals(typeof(PSArgumentCompleterAttribute))); ValueFromPipeline = ParameterAttribute.ValueFromPipeline; ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; @@ -295,10 +312,10 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met IsMandatory = ParameterAttribute.Mandatory; var complexParameterName = ParameterName.ToUpperInvariant(); - var complexMessage = $"{Environment.NewLine}To construct, see NOTES section for {complexParameterName} properties and create a hash table."; + var complexMessage = $"{Environment.NewLine}"; var description = ParameterAttribute.HelpMessage.NullIfEmpty() ?? HelpInfo.Description.NullIfEmpty() ?? InfoAttribute?.Description.NullIfEmpty() ?? String.Empty; // Remove the complex type message as it will be reinserted if this is a complex type - description = description.NormalizeNewLines().Replace(complexMessage, String.Empty).Replace(complexMessage.ToPsSingleLine(), String.Empty); + description = description.NormalizeNewLines(); // Make an InfoAttribute for processing only if one isn't provided InfoAttribute = Attributes.OfType().FirstOrDefault() ?? new InfoAttribute { PossibleTypes = new[] { ParameterType.Unwrap() }, Required = IsMandatory }; // Set the description if the InfoAttribute does not have one since they are exported without a description @@ -318,7 +335,7 @@ internal class ComplexInterfaceInfo public bool Required { get; } public bool ReadOnly { get; } public string Description { get; } - + public ComplexInterfaceInfo[] NestedInfos { get; } public bool IsComplexInterface { get; } @@ -335,7 +352,7 @@ public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, var unwrappedType = Type.Unwrap(); var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); - NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[] { } : unwrappedType.GetInterfaces() .Concat(InfoAttribute.PossibleTypes) .SelectMany(pt => pt.GetProperties() @@ -366,6 +383,7 @@ internal class CommentInfo public string OnlineVersion { get; } public string[] RelatedLinks { get; } + public string[] ExternalUrls { get; } private const string HelpLinkPrefix = @"https://learn.microsoft.com/powershell/module/"; @@ -374,6 +392,7 @@ public CommentInfo(VariantGroup variantGroup) var helpInfo = variantGroup.HelpInfo; Description = variantGroup.Variants.SelectMany(v => v.Attributes).OfType().FirstOrDefault()?.Description.NullIfEmpty() ?? helpInfo.Description.EmptyIfNull(); + Description = PsHelpInfo.CapitalizeFirstLetter(Description); // If there is no Synopsis, PowerShell may put in the Syntax string as the Synopsis. This seems unintended, so we remove the Synopsis in this situation. var synopsis = helpInfo.Synopsis.EmptyIfNull().Trim().StartsWith(variantGroup.CmdletName) ? String.Empty : helpInfo.Synopsis; Synopsis = synopsis.NullIfEmpty() ?? Description; @@ -391,6 +410,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 +442,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 +465,7 @@ public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterG Name = infoAttribute.Name; Description = infoAttribute.Description; Script = infoAttribute.Script; + SetCondition = infoAttribute.SetCondition; ParameterGroup = parameterGroup; } @@ -479,7 +513,8 @@ public static Parameter[] ToParameters(this Variant variant) parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount"); } var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))); - if (variant.SupportsPaging) { + if (variant.SupportsPaging) + { // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters variant.Info.Parameters["First"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects."; variant.Info.Parameters["Skip"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects."; @@ -507,7 +542,7 @@ public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute inf public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); - + public static PSArgumentCompleterInfo ToPSArgumentCompleterInfo(this PSArgumentCompleterAttribute completerAttribute) => new PSArgumentCompleterInfo(completerAttribute); public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/PsAttributes.cs index b6cb350d10c8..9fc65863ca14 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/PsAttributes.cs @@ -22,6 +22,11 @@ public class DoNotExportAttribute : Attribute { } + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class ModelCmdletAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Class)] public class InternalExportAttribute : Attribute { @@ -55,6 +60,11 @@ public class HttpPathAttribute : Attribute public string ApiVersion { get; set; } } + [AttributeUsage(AttributeTargets.Class)] + public class NotSuggestDefaultParameterSetAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] public class CategoryAttribute : Attribute { @@ -109,6 +119,11 @@ public enum PropertyOrigin Inlined } + [AttributeUsage(AttributeTargets.Property)] + public class ConstantAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Property)] public class FormatTableAttribute : Attribute { diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/PsExtensions.cs index a4961ab462d8..5459f21ad84b 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PowerShell { internal static class PsExtensions { + public static PSObject AddMultipleTypeNameIntoPSObject(this object obj, string multipleTag = "#Multiple") + { + var psObj = new PSObject(obj); + psObj.TypeNames.Insert(0, $"{psObj.TypeNames[0]}{multipleTag}"); + return psObj; + } + // https://stackoverflow.com/a/863944/294804 // https://stackoverflow.com/a/4452598/294804 // https://stackoverflow.com/a/28701974/294804 diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/PsHelpers.cs index 36ac509b098b..70c4701aa9ba 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/BuildTime/PsHelpers.cs @@ -67,7 +67,7 @@ public static IEnumerable GetScriptHelpInfo(params string[] modulePath public static IEnumerable GetModuleCmdletsAndHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) { - var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => + var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => $@"(Get-Command -Module (Import-Module '{mp}' -PassThru) | Where-Object {{ $_.CommandType -ne 'Alias' }} | ForEach-Object {{ @{{ CommandInfo = $_; HelpInfo = ( invoke-command {{ try {{ Get-Help -Name $_.Name -Full }} catch{{ '' }} }} ) }} }})" )); return (cmdlet?.RunScript(getCmdletAndHelp) ?? RunScript(getCmdletAndHelp)) @@ -88,7 +88,7 @@ public static Guid ReadGuidFromPsd1(string psd1Path) if (File.Exists(psd1Path)) { var currentGuid = File.ReadAllLines(psd1Path) - .FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) + .FirstOrDefault(l => l.TrimStart().StartsWith(GuidStart.TrimStart()))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) .LastOrDefault()?.Replace("'", String.Empty); guid = currentGuid != null ? Guid.Parse(currentGuid) : guid; } diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Context.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..050a17efe439 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.Extensions; + + /// + /// The IContext Interface defines the communication mechanism for input customization. + /// + /// + /// In the context, we will have client, pipeline, PSBoundParameters, 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.HealthcareApis.HealthcareApis Client { get; } + } +} diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Events.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Events.cs index 89d2792d2fdf..fca043994bf0 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Events.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Events.cs @@ -22,6 +22,6 @@ public static partial class Events public const string FollowingNextLink = nameof(FollowingNextLink); public const string DelayBeforePolling = nameof(DelayBeforePolling); public const string Polling = nameof(Polling); - + public const string Progress = nameof(Progress); } -} \ No newline at end of file +} diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/ISendAsync.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/ISendAsync.cs index 488c7aa21204..4b1cdf572ecb 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime using System.Threading.Tasks; using System.Collections; using System.Linq; + using System; + /// /// The interface for sending an HTTP request across the wire. @@ -70,6 +72,7 @@ public interface ISendAsyncTerminalFactory public partial class HttpPipeline : ISendAsync { + private const int DefaultMaxRetry = 3; private ISendAsync pipeline; private ISendAsyncTerminalFactory terminal; private List steps = new List(); @@ -92,6 +95,111 @@ public HttpPipeline(ISendAsyncTerminalFactory terminalStep) /// public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline }; + private bool shouldRetry429(HttpResponseMessage response) + { + if (response.StatusCode == (System.Net.HttpStatusCode)429) + { + var retryAfter = response.Headers.RetryAfter; + if (retryAfter != null && retryAfter.Delta.HasValue) + { + return true; + } + } + return false; + } + /// + /// The step to handle 429 response with retry-after header. + /// + public async Task Retry429(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = int.MaxValue; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES_FOR_429")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES_FOR_429")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetry429(response) && count++ < retryCount) + { + request = await cloneRequest.CloneWithContent(); + var retryAfter = response.Headers.RetryAfter; + await Task.Delay(retryAfter.Delta.Value, callback.Token); + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code 429 after waiting {retryAfter.Delta.Value.TotalSeconds} seconds."); + response = await next.SendAsync(request, callback); + } + return response; + } + + private bool shouldRetryError(HttpResponseMessage response) + { + if (response.StatusCode >= System.Net.HttpStatusCode.InternalServerError) + { + if (response.StatusCode != System.Net.HttpStatusCode.NotImplemented && + response.StatusCode != System.Net.HttpStatusCode.HttpVersionNotSupported) + { + return true; + } + } + else if (response.StatusCode == System.Net.HttpStatusCode.RequestTimeout) + { + return true; + } + else if (response.StatusCode == (System.Net.HttpStatusCode)429 && response.Headers.RetryAfter == null) + { + return true; + } + return false; + } + + /// + /// Returns true if status code in HttpRequestExceptionWithStatus exception is greater + /// than or equal to 500 and not NotImplemented (501) or HttpVersionNotSupported (505). + /// Or it's 429 (TOO MANY REQUESTS) without Retry-After header. + /// + public async Task RetryError(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = DefaultMaxRetry; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetryError(response) && count++ < retryCount) + { + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code {response.StatusCode}"); + request = await cloneRequest.CloneWithContent(); + response = await next.SendAsync(request, callback); + } + return response; + } + public ISendAsyncTerminalFactory TerminalFactory { get => terminal; @@ -117,6 +225,11 @@ public ISendAsync Pipeline // create the pipeline from scratch. var next = terminal.Create(); + if (Convert.ToBoolean(@"true")) + { + next = (new SendAsyncFactory(Retry429)).Create(next) ?? next; + next = (new SendAsyncFactory(RetryError)).Create(next) ?? next; + } foreach (var factory in steps) { // skip factories that return null. diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/InfoAttribute.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/InfoAttribute.cs index 11251dae256f..336dbe49e60f 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/InfoAttribute.cs @@ -11,6 +11,9 @@ public class InfoAttribute : Attribute { public bool Required { get; set; } = false; public bool ReadOnly { get; set; } = false; + public bool Read { get; set; } = true; + public bool Create { get; set; } = true; + public bool Update { get; set; } = true; public Type[] PossibleTypes { get; set; } = new Type[0]; public string Description { get; set; } = ""; public string SerializedName { get; set; } = ""; @@ -30,5 +33,6 @@ public class DefaultInfoAttribute : Attribute public string Script { get; set; } = ""; public string Name { get; set; } = ""; public string Description { get; set; } = ""; + public string SetCondition { get; set; } = ""; } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/InputHandler.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..c0e0d1a91eb7 --- /dev/null +++ b/generated/HealthcareApis/HealthcareApis.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.HealthcareApis.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.HealthcareApis.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/MessageAttribute.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/MessageAttribute.cs index 69c7decd41dd..43ae908f7feb 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/MessageAttribute.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/MessageAttribute.cs @@ -16,9 +16,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime public class GenericBreakingChangeAttribute : Attribute { private string _message; - //A dexcription of what the change is about, non mandatory + //A description of what the change is about, non mandatory public string ChangeDescription { get; set; } = null; + //Name of the module that is being deprecated + public string moduleName { get; set; } = String.IsNullOrEmpty(@"") ? @"Az.HealthcareApis" : @""; + //The version the change is effective from, non mandatory public string DeprecateByVersion { get; } public string DeprecateByAzVersion { get; } @@ -82,7 +85,7 @@ public void PrintCustomAttributeInfo(Action writeOutput) } writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByAzVersion, this.DeprecateByAzVersion)); - writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion)); + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.moduleName, this.DeprecateByVersion)); if (OldWay != null && NewWay != null) { @@ -191,11 +194,11 @@ public PreviewMessageAttribute(string message, string estimatedDateOfGa) : this( this.IsEstimatedGaDateSet = true; } } - + public void PrintCustomAttributeInfo(Action writeOutput) { writeOutput(this._message); - + if (IsEstimatedGaDateSet) { writeOutput(string.Format(Resources.PreviewCmdletETAMessage, this.EstimatedGaDate.ToShortDateString())); diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index de6edc233d6c..e6f2009602ff 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs @@ -21,6 +21,11 @@ internal XNodeArray(params JsonNode[] values) items = new List(values); } + internal XNodeArray(System.Collections.Generic.List values) + { + items = new List(values); + } + public override JsonNode this[int index] => items[index]; internal override JsonType? ElementType => null; diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Properties/Resources.resx b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Properties/Resources.resx index a08a2e50172b..4ef90b70573d 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/Properties/Resources.resx +++ b/generated/HealthcareApis/HealthcareApis.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 version : '{0}' +- The change is expected to take effect in '{0}' from version : '{1}' ```powershell diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/SerializationMode.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/SerializationMode.cs index b34eeeced3c0..3a4765794d98 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/SerializationMode.cs @@ -9,8 +9,10 @@ public enum SerializationMode { None = 0, IncludeHeaders = 1 << 0, - IncludeReadOnly = 1 << 1, - - IncludeAll = IncludeHeaders | IncludeReadOnly + IncludeRead = 1 << 1, + IncludeCreate = 1 << 2, + IncludeUpdate = 1 << 3, + IncludeAll = IncludeHeaders | IncludeRead | IncludeCreate | IncludeUpdate, + IncludeCreateOrUpdate = IncludeCreate | IncludeUpdate } } \ No newline at end of file diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/TypeConverterExtensions.cs index a069b5d6e30a..bb5a1c162767 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/HealthcareApis/HealthcareApis.Autorest/generated/runtime/TypeConverterExtensions.cs @@ -62,6 +62,56 @@ internal static T[] SelectToArray(object source, System.Func return result.ToArray(); } + internal static System.Collections.Generic.List SelectToList(object source, System.Func converter) + { + // null begets null + if (source == null) + { + return null; + } + + // single values and strings are just encapsulated in the array. + if (source is string || !(source is System.Collections.IEnumerable)) + { + try + { + return new T[] { (T)converter(source) }.ToList(); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + return new T[0].ToList(); // empty result if couldn't convert. + } + + var result = new System.Collections.Generic.List(); + foreach (var each in (System.Collections.IEnumerable)source) + { + try + { + result.Add((T)converter(each)); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + } + return result; + } internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.Generic.IDictionary dictionary) { if (null != dictionary) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcareOperation.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcareOperation.ps1 index 985b1d6fe1f2..2a2f00dbae95 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcareOperation.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcareOperation.ps1 @@ -25,12 +25,12 @@ Lists all of the available operations supported by Microsoft Healthcare resource {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetail .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareoperation #> function Get-AzHealthcareOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetail])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -89,12 +89,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.HealthcareApis.private\Get-AzHealthcareOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcareOperationResult.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcareOperationResult.ps1 index 292a497a3263..1c5dfa951d61 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcareOperationResult.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcareOperationResult.ps1 @@ -27,7 +27,7 @@ Get the operation result for a long running operation. .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescription +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription .Notes COMPLEX PARAMETER PROPERTIES @@ -47,14 +47,30 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +LOCATIONINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareoperationresult #> function Get-AzHealthcareOperationResult { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescription])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityLocation', Mandatory)] [Alias('OperationResultId')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] @@ -78,9 +94,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityLocation', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${LocationInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -137,14 +158,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.HealthcareApis.private\Get-AzHealthcareOperationResult_Get'; GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcareOperationResult_GetViaIdentity'; + GetViaIdentityLocation = 'Az.HealthcareApis.private\Get-AzHealthcareOperationResult_GetViaIdentityLocation'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -153,6 +176,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcarePrivateEndpointConnection.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcarePrivateEndpointConnection.ps1 deleted file mode 100644 index 0044451c518e..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcarePrivateEndpointConnection.ps1 +++ /dev/null @@ -1,193 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# 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 -Gets the specified private endpoint connection associated with the service. -.Description -Gets the specified private endpoint connection associated with the service. -.Example -{{ Add code here }} -.Example -{{ Add code here }} - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription -.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 - [DicomServiceName ]: The name of DICOM Service resource. - [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. - [FhirServiceName ]: The name of FHIR Service resource. - [GroupName ]: The name of the private link resource group. - [Id ]: Resource identity path - [IotConnectorName ]: The name of IoT Connector resource. - [LocationName ]: The location of the operation. - [OperationResultId ]: The ID of the operation result to get. - [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource - [ResourceGroupName ]: The name of the resource group that contains the service instance. - [ResourceName ]: The name of the service instance. - [SubscriptionId ]: The subscription identifier. - [WorkspaceName ]: The name of workspace resource. -.Link -https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareprivateendpointconnection -#> -function Get-AzHealthcarePrivateEndpointConnection { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription])] -[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] -param( - [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('PrivateEndpointConnectionName')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the private endpoint connection associated with the Azure resource - ${Name}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the resource group that contains the service instance. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the service instance. - ${ResourceName}, - - [Parameter(ParameterSetName='Get')] - [Parameter(ParameterSetName='List')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String[]] - # The subscription identifier. - ${SubscriptionId}, - - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] - # 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.HealthcareApis.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.HealthcareApis.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.private\Get-AzHealthcarePrivateEndpointConnection_Get'; - GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcarePrivateEndpointConnection_GetViaIdentity'; - List = 'Az.HealthcareApis.private\Get-AzHealthcarePrivateEndpointConnection_List'; - } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $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/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcarePrivateLinkResource.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcarePrivateLinkResource.ps1 deleted file mode 100644 index 9917305129cb..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcarePrivateLinkResource.ps1 +++ /dev/null @@ -1,192 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# 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 -Gets a private link resource that need to be created for a service. -.Description -Gets a private link resource that need to be created for a service. -.Example -{{ Add code here }} -.Example -{{ Add code here }} - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription -.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 - [DicomServiceName ]: The name of DICOM Service resource. - [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. - [FhirServiceName ]: The name of FHIR Service resource. - [GroupName ]: The name of the private link resource group. - [Id ]: Resource identity path - [IotConnectorName ]: The name of IoT Connector resource. - [LocationName ]: The location of the operation. - [OperationResultId ]: The ID of the operation result to get. - [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource - [ResourceGroupName ]: The name of the resource group that contains the service instance. - [ResourceName ]: The name of the service instance. - [SubscriptionId ]: The subscription identifier. - [WorkspaceName ]: The name of workspace resource. -.Link -https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareprivatelinkresource -#> -function Get-AzHealthcarePrivateLinkResource { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription])] -[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] -param( - [Parameter(ParameterSetName='Get', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the private link resource group. - ${GroupName}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the resource group that contains the service instance. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the service instance. - ${ResourceName}, - - [Parameter(ParameterSetName='Get')] - [Parameter(ParameterSetName='List')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String[]] - # The subscription identifier. - ${SubscriptionId}, - - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] - # 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.HealthcareApis.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.HealthcareApis.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.private\Get-AzHealthcarePrivateLinkResource_Get'; - GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcarePrivateLinkResource_GetViaIdentity'; - List = 'Az.HealthcareApis.private\Get-AzHealthcarePrivateLinkResource_List'; - } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $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/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcareWorkspacePrivateEndpointConnection.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcareWorkspacePrivateEndpointConnection.ps1 index f8175be099ce..f62359cc07cf 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcareWorkspacePrivateEndpointConnection.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcareWorkspacePrivateEndpointConnection.ps1 @@ -27,7 +27,7 @@ Gets the specified private endpoint connection associated with the workspace. .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription .Notes COMPLEX PARAMETER PROPERTIES @@ -47,14 +47,30 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareworkspaceprivateendpointconnection #> function Get-AzHealthcareWorkspacePrivateEndpointConnection { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the private endpoint connection associated with the Azure resource @@ -86,9 +102,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -145,15 +166,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateEndpointConnection_Get'; GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentity'; + GetViaIdentityWorkspace = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentityWorkspace'; List = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateEndpointConnection_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -162,6 +185,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcareWorkspacePrivateLinkResource.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcareWorkspacePrivateLinkResource.ps1 index ac2f41b52723..c262b3190082 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcareWorkspacePrivateLinkResource.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/internal/Get-AzHealthcareWorkspacePrivateLinkResource.ps1 @@ -27,7 +27,7 @@ Gets a private link resource that need to be created for a workspace. .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription .Notes COMPLEX PARAMETER PROPERTIES @@ -47,14 +47,30 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareworkspaceprivatelinkresource #> function Get-AzHealthcareWorkspacePrivateLinkResource { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the private link resource group. @@ -86,9 +102,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -145,15 +166,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateLinkResource_Get'; GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateLinkResource_GetViaIdentity'; + GetViaIdentityWorkspace = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateLinkResource_GetViaIdentityWorkspace'; List = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateLinkResource_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -162,6 +185,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareApisService.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareApisService.ps1 index 2491df9ce52c..4279259cd700 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareApisService.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareApisService.ps1 @@ -16,14 +16,14 @@ <# .Synopsis -Create or update the metadata of a service instance. +Create the metadata of a service instance. .Description -Create or update the metadata of a service instance. +Create the metadata of a service instance. .Example New-AzHealthcareApisService -ResourceGroupName azps_test_group -Name azpsapiservice -Kind 'fhir' -Location eastus2 -CosmosOfferThroughput 400 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription .Notes COMPLEX PARAMETER PROPERTIES @@ -40,12 +40,12 @@ ACRCONFIGURATIONOCIARTIFACT : The list of Open Conta PRIVATEENDPOINTCONNECTION : The list of private endpoint connections that are set up for this resource. [PrivateLinkServiceConnectionStateActionsRequired ]: A message indicating if changes on the service provider require any updates on the consumer. [PrivateLinkServiceConnectionStateDescription ]: The reason for approval/rejection of the connection. - [PrivateLinkServiceConnectionStateStatus ]: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + [PrivateLinkServiceConnectionStateStatus ]: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareapisservice #> function New-AzHealthcareApisService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -67,146 +67,154 @@ param( # The subscription identifier. ${SubscriptionId}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind])] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir", "fhir-Stu3", "fhir-R4")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind] + [System.String] # The kind of the service. ${Kind}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry[]] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntry[]] # The access policies of the service instance. - # To construct, see NOTES section for ACCESSPOLICYOBJECTID properties and create a hash table. ${AccessPolicyObjectId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The list of the ACR login servers. ${AcrConfigurationLoginServer}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[]] # The list of Open Container Initiative (OCI) artifacts. - # To construct, see NOTES section for ACRCONFIGURATIONOCIARTIFACT properties and create a hash table. ${AcrConfigurationOciArtifact}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Management.Automation.SwitchParameter] # If credentials are allowed via CORS. ${AllowCorsCredential}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The audience url for the service ${Audience}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The authority url for the service ${Authority}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The headers to be allowed via CORS. ${CorsHeader}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Int32] # The max age to be allowed via CORS. ${CorsMaxAge}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The methods to be allowed via CORS. ${CorsMethod}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The origins to be allowed via CORS. ${CorsOrigin}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The URI of the customer-managed key for the backing database. ${CosmosKeyVaultKeyUri}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Int32] # The provisioned throughput for the backing database. ${CosmosOfferThroughput}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Management.Automation.SwitchParameter] # If the SMART on FHIR proxy is enabled ${EnableSmartProxy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The name of the default export storage account. ${ExportStorageAccountName}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection[]] # The list of private endpoint connections that are set up for this resource. - # To construct, see NOTES section for PRIVATEENDPOINTCONNECTION properties and create a hash table. ${PrivateEndpointConnection}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess] + [System.String] # Control permission for data plane traffic coming from public networks while private endpoint is enabled. ${PublicNetworkAccess}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags]))] [System.Collections.Hashtable] # The resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -275,13 +283,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareApisService_CreateExpanded'; + CreateViaJsonFilePath = 'Az.HealthcareApis.private\New-AzHealthcareApisService_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.HealthcareApis.private\New-AzHealthcareApisService_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -290,6 +301,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareApisWorkspace.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareApisWorkspace.ps1 index 38718555075a..3018f84211a3 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareApisWorkspace.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareApisWorkspace.ps1 @@ -16,19 +16,19 @@ <# .Synopsis -Creates or updates a workspace resource with the specified parameters. +Create a workspace resource with the specified parameters. .Description -Creates or updates a workspace resource with the specified parameters. +Create a workspace resource with the specified parameters. .Example New-AzHealthcareApisWorkspace -Name azpshcws -ResourceGroupName azps_test_group -Location eastus2 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareapisworkspace #> function New-AzHealthcareApisWorkspace { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -51,32 +51,44 @@ param( # The subscription identifier. ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess] + [System.String] # Control permission for data plane traffic coming from public networks while private endpoint is enabled. ${PublicNetworkAccess}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -145,13 +157,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareApisWorkspace_CreateExpanded'; + CreateViaJsonFilePath = 'Az.HealthcareApis.private\New-AzHealthcareApisWorkspace_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.HealthcareApis.private\New-AzHealthcareApisWorkspace_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -160,6 +175,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareDicomService.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareDicomService.ps1 index cee345a82747..99eeccf11c22 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareDicomService.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareDicomService.ps1 @@ -16,19 +16,40 @@ <# .Synopsis -Creates or updates a DICOM Service resource with the specified parameters. +Create a DICOM Service resource with the specified parameters. .Description -Creates or updates a DICOM Service resource with the specified parameters. +Create a DICOM Service resource with the specified parameters. .Example New-AzHealthcareDicomService -Name azpsdicom -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Location eastus2 +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService +.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. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcaredicomservice #> function New-AzHealthcareDicomService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -38,67 +59,95 @@ param( # The name of DICOM Service resource. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of workspace resource. - ${WorkspaceName}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The subscription identifier. ${SubscriptionId}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] - # An etag associated with the resource, used for optimistic concurrency when editing it. - ${Etag}, + # The name of workspace resource. + ${WorkspaceName}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType])] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities]))] - [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, + [System.String] + # An etag associated with the resource, used for optimistic concurrency when editing it. + ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess] + [System.String] # Control permission for data plane traffic coming from public networks while private endpoint is enabled. ${PublicNetworkAccess}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, + + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -167,13 +216,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareDicomService_CreateExpanded'; + CreateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\New-AzHealthcareDicomService_CreateViaIdentityWorkspaceExpanded'; + CreateViaJsonFilePath = 'Az.HealthcareApis.private\New-AzHealthcareDicomService_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.HealthcareApis.private\New-AzHealthcareDicomService_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -182,6 +235,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareFhirService.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareFhirService.ps1 index 803a254fb1c9..7cd373feb3d5 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareFhirService.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareFhirService.ps1 @@ -16,14 +16,16 @@ <# .Synopsis -Creates or updates a FHIR Service resource with the specified parameters. +Create a FHIR Service resource with the specified parameters. .Description -Creates or updates a FHIR Service resource with the specified parameters. +Create a FHIR Service resource with the specified parameters. .Example New-AzHealthcareFhirService -Name azpsfhirservice -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Location eastus2 -Kind 'fhir-R4' -Authority "https://login.microsoftonline.com/{DirectoryID}" -Audience "https://azpshcws-{FhirServiceName}.fhir.azurehealthcareapis.com" +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService .Notes COMPLEX PARAMETER PROPERTIES @@ -36,11 +38,26 @@ ACRCONFIGURATIONOCIARTIFACT : The list of Open Conta [Digest ]: The artifact digest. [ImageName ]: The artifact name. [LoginServer ]: The Azure Container Registry login server. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcarefhirservice #> function New-AzHealthcareFhirService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -50,168 +67,209 @@ param( # The name of FHIR Service resource. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription identifier. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. ${WorkspaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The subscription identifier. - ${SubscriptionId}, + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry[]] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry[]] # Fhir Service access policies. - # To construct, see NOTES section for ACCESSPOLICYOBJECTID properties and create a hash table. ${AccessPolicyObjectId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The list of the Azure container registry login servers. ${AcrConfigurationLoginServer}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[]] # The list of Open Container Initiative (OCI) artifacts. - # To construct, see NOTES section for ACRCONFIGURATIONOCIARTIFACT properties and create a hash table. ${AcrConfigurationOciArtifact}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Management.Automation.SwitchParameter] # If credentials are allowed via CORS. ${AllowCorsCredential}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The audience url for the service ${Audience}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The authority url for the service ${Authority}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The headers to be allowed via CORS. ${CorsHeader}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Int32] # The max age to be allowed via CORS. ${CorsMaxAge}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The methods to be allowed via CORS. ${CorsMethod}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The origins to be allowed via CORS. ${CorsOrigin}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Management.Automation.SwitchParameter] # If the SMART on FHIR proxy is enabled ${EnableSmartProxy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The name of the default export storage account. ${ExportStorageAccountName}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities]))] - [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir-Stu3", "fhir-R4")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind] + [System.String] # The kind of the service. ${Kind}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess] + [System.String] # Control permission for data plane traffic coming from public networks while private endpoint is enabled. ${PublicNetworkAccess}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("no-version", "versioned", "versioned-update")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy] + [System.String] # The default value for tracking history across all resources. ${ResourceVersionPolicyConfigurationDefault}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides]))] [System.Collections.Hashtable] # A list of FHIR Resources and their version policy overrides. ${ResourceVersionPolicyConfigurationResourceTypeOverride}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, + + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -280,13 +338,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareFhirService_CreateExpanded'; + CreateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\New-AzHealthcareFhirService_CreateViaIdentityWorkspaceExpanded'; + CreateViaJsonFilePath = 'Az.HealthcareApis.private\New-AzHealthcareFhirService_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.HealthcareApis.private\New-AzHealthcareFhirService_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -295,6 +357,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareIotConnector.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareIotConnector.ps1 index b89f71a43d26..eb3d84800fbb 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareIotConnector.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareIotConnector.ps1 @@ -16,20 +16,41 @@ <# .Synopsis -Creates or updates an IoT Connector resource with the specified parameters. +Create an IoT Connector resource with the specified parameters. .Description -Creates or updates an IoT Connector resource with the specified parameters. +Create an IoT Connector resource with the specified parameters. .Example $arr = @() New-AzHealthcareIotConnector -Name azpsiotconnector -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Location eastus2 -IngestionEndpointConfigurationConsumerGroup "sajob-01-portal_input-01_consumer_group" -IngestionEndpointConfigurationEventHubName "sajob01portaleventhub" -IngestionEndpointConfigurationFullyQualifiedEventHubNamespace "sdk-Namespace-4761.servicebus.windows.net" -DeviceMappingContent @{"templateType"="CollectionContent";"template"=$arr} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector +.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. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareiotconnector #> function New-AzHealthcareIotConnector { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -39,85 +60,116 @@ param( # The name of IoT Connector resource. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription identifier. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. ${WorkspaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The subscription identifier. - ${SubscriptionId}, + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent]))] [System.Collections.Hashtable] # The mapping. ${DeviceMappingContent}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities]))] - [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # Consumer group of the event hub to connected to. ${IngestionEndpointConfigurationConsumerGroup}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # Event Hub name to connect to. ${IngestionEndpointConfigurationEventHubName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # Fully qualified namespace of the Event Hub to connect to. ${IngestionEndpointConfigurationFullyQualifiedEventHubNamespace}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, + + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -186,13 +238,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareIotConnector_CreateExpanded'; + CreateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\New-AzHealthcareIotConnector_CreateViaIdentityWorkspaceExpanded'; + CreateViaJsonFilePath = 'Az.HealthcareApis.private\New-AzHealthcareIotConnector_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.HealthcareApis.private\New-AzHealthcareIotConnector_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -201,6 +257,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareIotConnectorFhirDestination.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareIotConnectorFhirDestination.ps1 index 161f39b5ad93..e76bcbd85a77 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareIotConnectorFhirDestination.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareIotConnectorFhirDestination.ps1 @@ -16,20 +16,56 @@ <# .Synopsis -Creates or updates an IoT Connector FHIR destination resource with the specified parameters. +Create an IoT Connector FHIR destination resource with the specified parameters. .Description -Creates or updates an IoT Connector FHIR destination resource with the specified parameters. +Create an IoT Connector FHIR destination resource with the specified parameters. .Example $arr = @() New-AzHealthcareIotConnectorFhirDestination -FhirDestinationName azpsfhirdestination -IotConnectorName azpsiotconnector -ResourceGroupName azps_test_group -WorkspaceName azpshcws -FhirServiceResourceId "/subscriptions/{SubscriptionId}/resourceGroups/azps_test_group/providers/Microsoft.HealthcareApis/workspaces/azpshcws/fhirservices/azpsfhirservice" -ResourceIdentityResolutionType 'Create' -Location eastus2 -FhirMappingContent @{"templateType"="CollectionFhirTemplate";"template"=$arr} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination +.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. + +IOTCONNECTORINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareiotconnectorfhirdestination #> function New-AzHealthcareIotConnectorFhirDestination { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -38,63 +74,106 @@ param( # The name of IoT Connector FHIR destination resource. ${FhirDestinationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of IoT Connector resource. ${IotConnectorName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription identifier. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. ${WorkspaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The subscription identifier. - ${SubscriptionId}, + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${IotconnectorInputObject}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # Fully qualified resource id of the FHIR service to connect to. ${FhirServiceResourceId}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType])] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Create", "Lookup")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType] + [System.String] # Determines how resource identity is resolved on the destination. ${ResourceIdentityResolutionType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent]))] [System.Collections.Hashtable] # The mapping. ${FhirMappingContent}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -163,13 +242,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareIotConnectorFhirDestination_CreateExpanded'; + CreateViaIdentityIotconnectorExpanded = 'Az.HealthcareApis.private\New-AzHealthcareIotConnectorFhirDestination_CreateViaIdentityIotconnectorExpanded'; + CreateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\New-AzHealthcareIotConnectorFhirDestination_CreateViaIdentityWorkspaceExpanded'; + CreateViaJsonFilePath = 'Az.HealthcareApis.private\New-AzHealthcareIotConnectorFhirDestination_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.HealthcareApis.private\New-AzHealthcareIotConnectorFhirDestination_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -178,6 +262,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcarePrivateEndpointConnection.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcarePrivateEndpointConnection.ps1 deleted file mode 100644 index 61bcc9589a9f..000000000000 --- a/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcarePrivateEndpointConnection.ps1 +++ /dev/null @@ -1,191 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# 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 -Update the state of the specified private endpoint connection associated with the service. -.Description -Update the state of the specified private endpoint connection associated with the service. -.Example -{{ Add code here }} -.Example -{{ Add code here }} - -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription -.Link -https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareprivateendpointconnection -#> -function New-AzHealthcarePrivateEndpointConnection { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(Mandatory)] - [Alias('PrivateEndpointConnectionName')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the private endpoint connection associated with the Azure resource - ${Name}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the resource group that contains the service instance. - ${ResourceGroupName}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the service instance. - ${ResourceName}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The subscription identifier. - ${SubscriptionId}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.String] - # A message indicating if changes on the service provider require any updates on the consumer. - ${PrivateLinkServiceConnectionStateActionsRequired}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.String] - # The reason for approval/rejection of the connection. - ${PrivateLinkServiceConnectionStateDescription}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus] - # Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - ${PrivateLinkServiceConnectionStateStatus}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 = @{ - CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcarePrivateEndpointConnection_CreateExpanded'; - } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $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/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareWorkspacePrivateEndpointConnection.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareWorkspacePrivateEndpointConnection.ps1 index cddd4cffee78..f8af36f9c0f4 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareWorkspacePrivateEndpointConnection.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/internal/New-AzHealthcareWorkspacePrivateEndpointConnection.ps1 @@ -16,21 +16,42 @@ <# .Synopsis -Update the state of the specified private endpoint connection associated with the workspace. +Create the state of the specified private endpoint connection associated with the workspace. .Description -Update the state of the specified private endpoint connection associated with the workspace. +Create the state of the specified private endpoint connection associated with the workspace. .Example {{ Add code here }} .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription +.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. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareworkspaceprivateendpointconnection #> function New-AzHealthcareWorkspacePrivateEndpointConnection { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -39,44 +60,71 @@ param( # The name of the private endpoint connection associated with the Azure resource ${PrivateEndpointConnectionName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription identifier. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. ${WorkspaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The subscription identifier. - ${SubscriptionId}, + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # A message indicating if changes on the service provider require any updates on the consumer. ${PrivateLinkServiceConnectionStateActionsRequired}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The reason for approval/rejection of the connection. ${PrivateLinkServiceConnectionStateDescription}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus] + [System.String] # Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. ${PrivateLinkServiceConnectionStateStatus}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -145,13 +193,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareWorkspacePrivateEndpointConnection_CreateExpanded'; + CreateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\New-AzHealthcareWorkspacePrivateEndpointConnection_CreateViaIdentityWorkspaceExpanded'; + CreateViaJsonFilePath = 'Az.HealthcareApis.private\New-AzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.HealthcareApis.private\New-AzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -160,6 +212,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/internal/ProxyCmdletDefinitions.ps1 index 895319b0fe1d..72a83f35f3e1 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -27,7 +27,7 @@ Get the operation result for a long running operation. .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescription +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription .Notes COMPLEX PARAMETER PROPERTIES @@ -47,14 +47,30 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +LOCATIONINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareoperationresult #> function Get-AzHealthcareOperationResult { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationResultsDescription])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationResultsDescription])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityLocation', Mandatory)] [Alias('OperationResultId')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] @@ -78,9 +94,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityLocation', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${LocationInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -137,14 +158,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.HealthcareApis.private\Get-AzHealthcareOperationResult_Get'; GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcareOperationResult_GetViaIdentity'; + GetViaIdentityLocation = 'Az.HealthcareApis.private\Get-AzHealthcareOperationResult_GetViaIdentityLocation'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -153,6 +176,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -193,12 +219,12 @@ Lists all of the available operations supported by Microsoft Healthcare resource {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetail .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareoperation #> function Get-AzHealthcareOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IOperationDetail])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IOperationDetail])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -257,12 +283,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.HealthcareApis.private\Get-AzHealthcareOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -294,9 +326,9 @@ end { <# .Synopsis -Gets the specified private endpoint connection associated with the service. +Gets the specified private endpoint connection associated with the workspace. .Description -Gets the specified private endpoint connection associated with the service. +Gets the specified private endpoint connection associated with the workspace. .Example {{ Add code here }} .Example @@ -305,7 +337,7 @@ Gets the specified private endpoint connection associated with the service. .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription .Notes COMPLEX PARAMETER PROPERTIES @@ -325,19 +357,34 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link -https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareprivateendpointconnection +https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareworkspaceprivateendpointconnection #> -function Get-AzHealthcarePrivateEndpointConnection { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription])] +function Get-AzHealthcareWorkspacePrivateEndpointConnection { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('PrivateEndpointConnectionName')] + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the private endpoint connection associated with the Azure resource - ${Name}, + ${PrivateEndpointConnectionName}, [Parameter(ParameterSetName='Get', Mandatory)] [Parameter(ParameterSetName='List', Mandatory)] @@ -346,13 +393,6 @@ param( # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the service instance. - ${ResourceName}, - [Parameter(ParameterSetName='Get')] [Parameter(ParameterSetName='List')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] @@ -361,13 +401,25 @@ param( # The subscription identifier. ${SubscriptionId}, + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [System.String] + # The name of workspace resource. + ${WorkspaceName}, + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -424,15 +476,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - Get = 'Az.HealthcareApis.private\Get-AzHealthcarePrivateEndpointConnection_Get'; - GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcarePrivateEndpointConnection_GetViaIdentity'; - List = 'Az.HealthcareApis.private\Get-AzHealthcarePrivateEndpointConnection_List'; + Get = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateEndpointConnection_Get'; + GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentity'; + GetViaIdentityWorkspace = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentityWorkspace'; + List = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateEndpointConnection_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -441,6 +495,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -472,9 +529,9 @@ end { <# .Synopsis -Gets a private link resource that need to be created for a service. +Gets a private link resource that need to be created for a workspace. .Description -Gets a private link resource that need to be created for a service. +Gets a private link resource that need to be created for a workspace. .Example {{ Add code here }} .Example @@ -483,7 +540,7 @@ Gets a private link resource that need to be created for a service. .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription .Notes COMPLEX PARAMETER PROPERTIES @@ -503,14 +560,30 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link -https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareprivatelinkresource +https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareworkspaceprivatelinkresource #> -function Get-AzHealthcarePrivateLinkResource { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription])] +function Get-AzHealthcareWorkspacePrivateLinkResource { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateLinkResourceDescription])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the private link resource group. @@ -523,13 +596,6 @@ param( # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the service instance. - ${ResourceName}, - [Parameter(ParameterSetName='Get')] [Parameter(ParameterSetName='List')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] @@ -538,13 +604,25 @@ param( # The subscription identifier. ${SubscriptionId}, + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [System.String] + # The name of workspace resource. + ${WorkspaceName}, + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityWorkspace', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -601,15 +679,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - Get = 'Az.HealthcareApis.private\Get-AzHealthcarePrivateLinkResource_Get'; - GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcarePrivateLinkResource_GetViaIdentity'; - List = 'Az.HealthcareApis.private\Get-AzHealthcarePrivateLinkResource_List'; + Get = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateLinkResource_Get'; + GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateLinkResource_GetViaIdentity'; + GetViaIdentityWorkspace = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateLinkResource_GetViaIdentityWorkspace'; + List = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateLinkResource_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -618,6 +698,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -649,726 +732,205 @@ end { <# .Synopsis -Gets the specified private endpoint connection associated with the workspace. +Create the metadata of a service instance. .Description -Gets the specified private endpoint connection associated with the workspace. -.Example -{{ Add code here }} +Create the metadata of a service instance. .Example -{{ Add code here }} +New-AzHealthcareApisService -ResourceGroupName azps_test_group -Name azpsapiservice -Kind 'fhir' -Location eastus2 -CosmosOfferThroughput 400 -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription .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 - [DicomServiceName ]: The name of DICOM Service resource. - [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. - [FhirServiceName ]: The name of FHIR Service resource. - [GroupName ]: The name of the private link resource group. - [Id ]: Resource identity path - [IotConnectorName ]: The name of IoT Connector resource. - [LocationName ]: The location of the operation. - [OperationResultId ]: The ID of the operation result to get. - [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource - [ResourceGroupName ]: The name of the resource group that contains the service instance. - [ResourceName ]: The name of the service instance. - [SubscriptionId ]: The subscription identifier. - [WorkspaceName ]: The name of workspace resource. +ACCESSPOLICYOBJECTID : The access policies of the service instance. + ObjectId : An Azure AD object ID (User or Apps) that is allowed access to the FHIR service. + +ACRCONFIGURATIONOCIARTIFACT : The list of Open Container Initiative (OCI) artifacts. + [Digest ]: The artifact digest. + [ImageName ]: The artifact name. + [LoginServer ]: The Azure Container Registry login server. + +PRIVATEENDPOINTCONNECTION : The list of private endpoint connections that are set up for this resource. + [PrivateLinkServiceConnectionStateActionsRequired ]: A message indicating if changes on the service provider require any updates on the consumer. + [PrivateLinkServiceConnectionStateDescription ]: The reason for approval/rejection of the connection. + [PrivateLinkServiceConnectionStateStatus ]: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. .Link -https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareworkspaceprivateendpointconnection +https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareapisservice #> -function Get-AzHealthcareWorkspacePrivateEndpointConnection { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription])] -[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +function New-AzHealthcareApisService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesDescription])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] - # The name of the private endpoint connection associated with the Azure resource - ${PrivateEndpointConnectionName}, + # The name of the service instance. + ${Name}, - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(ParameterSetName='Get')] - [Parameter(ParameterSetName='List')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String[]] + [System.String] # The subscription identifier. ${SubscriptionId}, - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir", "fhir-Stu3", "fhir-R4")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] - # The name of workspace resource. - ${WorkspaceName}, + # The kind of the service. + ${Kind}, - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # The resource location. + ${Location}, - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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(ParameterSetName='CreateExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceAccessPolicyEntry[]] + # The access policies of the service instance. + ${AccessPolicyObjectId}, - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, + [Parameter(ParameterSetName='CreateExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The list of the ACR login servers. + ${AcrConfigurationLoginServer}, - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, + [Parameter(ParameterSetName='CreateExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[]] + # The list of Open Container Initiative (OCI) artifacts. + ${AcrConfigurationOciArtifact}, - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # If credentials are allowed via CORS. + ${AllowCorsCredential}, - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # The audience url for the service + ${Audience}, - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # The authority url for the service + ${Authority}, - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Use the default credentials for the proxy - ${ProxyUseDefaultCredentials} -) + [Parameter(ParameterSetName='CreateExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The headers to be allowed via CORS. + ${CorsHeader}, -begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - $parameterSet = $PSCmdlet.ParameterSetName + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Int32] + # The max age to be allowed via CORS. + ${CorsMaxAge}, - $mapping = @{ - Get = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateEndpointConnection_Get'; - GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateEndpointConnection_GetViaIdentity'; - List = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateEndpointConnection_List'; - } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $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 -Gets a private link resource that need to be created for a workspace. -.Description -Gets a private link resource that need to be created for a workspace. -.Example -{{ Add code here }} -.Example -{{ Add code here }} - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription -.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 - [DicomServiceName ]: The name of DICOM Service resource. - [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. - [FhirServiceName ]: The name of FHIR Service resource. - [GroupName ]: The name of the private link resource group. - [Id ]: Resource identity path - [IotConnectorName ]: The name of IoT Connector resource. - [LocationName ]: The location of the operation. - [OperationResultId ]: The ID of the operation result to get. - [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource - [ResourceGroupName ]: The name of the resource group that contains the service instance. - [ResourceName ]: The name of the service instance. - [SubscriptionId ]: The subscription identifier. - [WorkspaceName ]: The name of workspace resource. -.Link -https://learn.microsoft.com/powershell/module/az.healthcareapis/get-azhealthcareworkspaceprivatelinkresource -#> -function Get-AzHealthcareWorkspacePrivateLinkResource { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateLinkResourceDescription])] -[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] -param( - [Parameter(ParameterSetName='Get', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the private link resource group. - ${GroupName}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the resource group that contains the service instance. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Get')] - [Parameter(ParameterSetName='List')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String[]] - # The subscription identifier. - ${SubscriptionId}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of workspace resource. - ${WorkspaceName}, - - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] - # 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.HealthcareApis.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.HealthcareApis.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateLinkResource_Get'; - GetViaIdentity = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateLinkResource_GetViaIdentity'; - List = 'Az.HealthcareApis.private\Get-AzHealthcareWorkspacePrivateLinkResource_List'; - } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $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 -Create or update the metadata of a service instance. -.Description -Create or update the metadata of a service instance. -.Example -New-AzHealthcareApisService -ResourceGroupName azps_test_group -Name azpsapiservice -Kind 'fhir' -Location eastus2 -CosmosOfferThroughput 400 - -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription -.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. - -ACCESSPOLICYOBJECTID : The access policies of the service instance. - ObjectId : An Azure AD object ID (User or Apps) that is allowed access to the FHIR service. - -ACRCONFIGURATIONOCIARTIFACT : The list of Open Container Initiative (OCI) artifacts. - [Digest ]: The artifact digest. - [ImageName ]: The artifact name. - [LoginServer ]: The Azure Container Registry login server. - -PRIVATEENDPOINTCONNECTION : The list of private endpoint connections that are set up for this resource. - [PrivateLinkServiceConnectionStateActionsRequired ]: A message indicating if changes on the service provider require any updates on the consumer. - [PrivateLinkServiceConnectionStateDescription ]: The reason for approval/rejection of the connection. - [PrivateLinkServiceConnectionStateStatus ]: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. -.Link -https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareapisservice -#> -function New-AzHealthcareApisService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesDescription])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the service instance. - ${Name}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the resource group that contains the service instance. - ${ResourceGroupName}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The subscription identifier. - ${SubscriptionId}, - - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.Kind] - # The kind of the service. - ${Kind}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.String] - # The resource location. - ${Location}, - - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceAccessPolicyEntry[]] - # The access policies of the service instance. - # To construct, see NOTES section for ACCESSPOLICYOBJECTID properties and create a hash table. - ${AccessPolicyObjectId}, - - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.String[]] - # The list of the ACR login servers. - ${AcrConfigurationLoginServer}, - - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]] - # The list of Open Container Initiative (OCI) artifacts. - # To construct, see NOTES section for ACRCONFIGURATIONOCIARTIFACT properties and create a hash table. - ${AcrConfigurationOciArtifact}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.Management.Automation.SwitchParameter] - # If credentials are allowed via CORS. - ${AllowCorsCredential}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.String] - # The audience url for the service - ${Audience}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.String] - # The authority url for the service - ${Authority}, - - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.String[]] - # The headers to be allowed via CORS. - ${CorsHeader}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.Int32] - # The max age to be allowed via CORS. - ${CorsMaxAge}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The methods to be allowed via CORS. ${CorsMethod}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String[]] # The origins to be allowed via CORS. - ${CorsOrigin}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.String] - # The URI of the customer-managed key for the backing database. - ${CosmosKeyVaultKeyUri}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.Int32] - # The provisioned throughput for the backing database. - ${CosmosOfferThroughput}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.Management.Automation.SwitchParameter] - # If the SMART on FHIR proxy is enabled - ${EnableSmartProxy}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.String] - # An etag associated with the resource, used for optimistic concurrency when editing it. - ${Etag}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.String] - # The name of the default export storage account. - ${ExportStorageAccountName}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ManagedServiceIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, - - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api10.IPrivateEndpointConnection[]] - # The list of private endpoint connections that are set up for this resource. - # To construct, see NOTES section for PRIVATEENDPOINTCONNECTION properties and create a hash table. - ${PrivateEndpointConnection}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess] - # Control permission for data plane traffic coming from public networks while private endpoint is enabled. - ${PublicNetworkAccess}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServicesResourceTags]))] - [System.Collections.Hashtable] - # The resource tags. - ${Tag}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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.HealthcareApis.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.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 = @{ - CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareApisService_CreateExpanded'; - } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $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 -Creates or updates a workspace resource with the specified parameters. -.Description -Creates or updates a workspace resource with the specified parameters. -.Example -New-AzHealthcareApisWorkspace -Name azpshcws -ResourceGroupName azps_test_group -Location eastus2 - -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace -.Link -https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareapisworkspace -#> -function New-AzHealthcareApisWorkspace { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IWorkspace])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(Mandatory)] - [Alias('WorkspaceName')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of workspace resource. - ${Name}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the resource group that contains the service instance. - ${ResourceGroupName}, + ${CorsOrigin}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] - # The subscription identifier. - ${SubscriptionId}, + # The URI of the customer-managed key for the backing database. + ${CosmosKeyVaultKeyUri}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Int32] + # The provisioned throughput for the backing database. + ${CosmosOfferThroughput}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # If the SMART on FHIR proxy is enabled + ${EnableSmartProxy}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] - # The resource location. - ${Location}, + # The name of the default export storage account. + ${ExportStorageAccountName}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='CreateExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnection[]] + # The list of private endpoint connections that are set up for this resource. + ${PrivateEndpointConnection}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess] + [System.String] # Control permission for data plane traffic coming from public networks while private endpoint is enabled. ${PublicNetworkAccess}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServicesResourceTags]))] [System.Collections.Hashtable] - # Resource tags. + # The resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1437,13 +999,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareApisWorkspace_CreateExpanded'; + CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareApisService_CreateExpanded'; + CreateViaJsonFilePath = 'Az.HealthcareApis.private\New-AzHealthcareApisService_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.HealthcareApis.private\New-AzHealthcareApisService_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1452,6 +1017,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1483,26 +1051,26 @@ end { <# .Synopsis -Creates or updates a DICOM Service resource with the specified parameters. +Create a workspace resource with the specified parameters. .Description -Creates or updates a DICOM Service resource with the specified parameters. +Create a workspace resource with the specified parameters. .Example -New-AzHealthcareDicomService -Name azpsdicom -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Location eastus2 +New-AzHealthcareApisWorkspace -Name azpshcws -ResourceGroupName azps_test_group -Location eastus2 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace .Link -https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcaredicomservice +https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareapisworkspace #> -function New-AzHealthcareDicomService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IDicomService])] +function New-AzHealthcareApisWorkspace { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IWorkspace])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('DicomServiceName')] + [Alias('WorkspaceName')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] - # The name of DICOM Service resource. + # The name of workspace resource. ${Name}, [Parameter(Mandatory)] @@ -1511,12 +1079,6 @@ param( # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of workspace resource. - ${WorkspaceName}, - [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] @@ -1524,48 +1086,44 @@ param( # The subscription identifier. ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities]))] - [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess] + [System.String] # Control permission for data plane traffic coming from public networks while private endpoint is enabled. ${PublicNetworkAccess}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1634,13 +1192,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareDicomService_CreateExpanded'; + CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareApisWorkspace_CreateExpanded'; + CreateViaJsonFilePath = 'Az.HealthcareApis.private\New-AzHealthcareApisWorkspace_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.HealthcareApis.private\New-AzHealthcareApisWorkspace_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1649,6 +1210,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1680,201 +1244,137 @@ end { <# .Synopsis -Creates or updates a FHIR Service resource with the specified parameters. +Create a DICOM Service resource with the specified parameters. .Description -Creates or updates a FHIR Service resource with the specified parameters. +Create a DICOM Service resource with the specified parameters. .Example -New-AzHealthcareFhirService -Name azpsfhirservice -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Location eastus2 -Kind 'fhir-R4' -Authority "https://login.microsoftonline.com/{DirectoryID}" -Audience "https://azpshcws-{FhirServiceName}.fhir.azurehealthcareapis.com" +New-AzHealthcareDicomService -Name azpsdicom -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Location eastus2 +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService .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. -ACCESSPOLICYOBJECTID : Fhir Service access policies. - ObjectId : An Azure AD object ID (User or Apps) that is allowed access to the FHIR service. - -ACRCONFIGURATIONOCIARTIFACT : The list of Open Container Initiative (OCI) artifacts. - [Digest ]: The artifact digest. - [ImageName ]: The artifact name. - [LoginServer ]: The Azure Container Registry login server. +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link -https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcarefhirservice +https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcaredicomservice #> -function New-AzHealthcareFhirService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirService])] +function New-AzHealthcareDicomService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IDicomService])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('FhirServiceName')] + [Alias('DicomServiceName')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] - # The name of FHIR Service resource. + # The name of DICOM Service resource. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of workspace resource. - ${WorkspaceName}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The subscription identifier. ${SubscriptionId}, - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IFhirServiceAccessPolicyEntry[]] - # Fhir Service access policies. - # To construct, see NOTES section for ACCESSPOLICYOBJECTID properties and create a hash table. - ${AccessPolicyObjectId}, - - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.String[]] - # The list of the Azure container registry login servers. - ${AcrConfigurationLoginServer}, - - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IServiceOciArtifactEntry[]] - # The list of Open Container Initiative (OCI) artifacts. - # To construct, see NOTES section for ACRCONFIGURATIONOCIARTIFACT properties and create a hash table. - ${AcrConfigurationOciArtifact}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.Management.Automation.SwitchParameter] - # If credentials are allowed via CORS. - ${AllowCorsCredential}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.String] - # The audience url for the service - ${Audience}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] - # The authority url for the service - ${Authority}, - - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.String[]] - # The headers to be allowed via CORS. - ${CorsHeader}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.Int32] - # The max age to be allowed via CORS. - ${CorsMaxAge}, - - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.String[]] - # The methods to be allowed via CORS. - ${CorsMethod}, + # The name of workspace resource. + ${WorkspaceName}, - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.String[]] - # The origins to be allowed via CORS. - ${CorsOrigin}, + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.Management.Automation.SwitchParameter] - # If the SMART on FHIR proxy is enabled - ${EnableSmartProxy}, + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.String] - # The name of the default export storage account. - ${ExportStorageAccountName}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities]))] - [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirServiceKind] - # The kind of the service. - ${Kind}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PublicNetworkAccess] + [System.String] # Control permission for data plane traffic coming from public networks while private endpoint is enabled. ${PublicNetworkAccess}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.FhirResourceVersionPolicy] - # The default value for tracking history across all resources. - ${ResourceVersionPolicyConfigurationDefault}, + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceVersionPolicyConfigurationResourceTypeOverrides]))] - [System.Collections.Hashtable] - # A list of FHIR Resources and their version policy overrides. - ${ResourceVersionPolicyConfigurationResourceTypeOverride}, + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -1944,13 +1444,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareFhirService_CreateExpanded'; + CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareDicomService_CreateExpanded'; + CreateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\New-AzHealthcareDicomService_CreateViaIdentityWorkspaceExpanded'; + CreateViaJsonFilePath = 'Az.HealthcareApis.private\New-AzHealthcareDicomService_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.HealthcareApis.private\New-AzHealthcareDicomService_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1959,6 +1463,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1988,87 +1495,262 @@ end { } } -<# -.Synopsis -Creates or updates an IoT Connector FHIR destination resource with the specified parameters. -.Description -Creates or updates an IoT Connector FHIR destination resource with the specified parameters. -.Example -$arr = @() -New-AzHealthcareIotConnectorFhirDestination -FhirDestinationName azpsfhirdestination -IotConnectorName azpsiotconnector -ResourceGroupName azps_test_group -WorkspaceName azpshcws -FhirServiceResourceId "/subscriptions/{SubscriptionId}/resourceGroups/azps_test_group/providers/Microsoft.HealthcareApis/workspaces/azpshcws/fhirservices/azpsfhirservice" -ResourceIdentityResolutionType 'Create' -Location eastus2 -FhirMappingContent @{"templateType"="CollectionFhirTemplate";"template"=$arr} +<# +.Synopsis +Create a FHIR Service resource with the specified parameters. +.Description +Create a FHIR Service resource with the specified parameters. +.Example +New-AzHealthcareFhirService -Name azpsfhirservice -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Location eastus2 -Kind 'fhir-R4' -Authority "https://login.microsoftonline.com/{DirectoryID}" -Audience "https://azpshcws-{FhirServiceName}.fhir.azurehealthcareapis.com" + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService +.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. + +ACCESSPOLICYOBJECTID : Fhir Service access policies. + ObjectId : An Azure AD object ID (User or Apps) that is allowed access to the FHIR service. + +ACRCONFIGURATIONOCIARTIFACT : The list of Open Container Initiative (OCI) artifacts. + [Digest ]: The artifact digest. + [ImageName ]: The artifact name. + [LoginServer ]: The Azure Container Registry login server. -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link -https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareiotconnectorfhirdestination +https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcarefhirservice #> -function New-AzHealthcareIotConnectorFhirDestination { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotFhirDestination])] +function New-AzHealthcareFhirService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirService])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] + [Alias('FhirServiceName')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] - # The name of IoT Connector FHIR destination resource. - ${FhirDestinationName}, + # The name of FHIR Service resource. + ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] - # The name of IoT Connector resource. - ${IotConnectorName}, + # The name of the resource group that contains the service instance. + ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] - # The name of the resource group that contains the service instance. - ${ResourceGroupName}, + # The subscription identifier. + ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. ${WorkspaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IFhirServiceAccessPolicyEntry[]] + # Fhir Service access policies. + ${AccessPolicyObjectId}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The list of the Azure container registry login servers. + ${AcrConfigurationLoginServer}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IServiceOciArtifactEntry[]] + # The list of Open Container Initiative (OCI) artifacts. + ${AcrConfigurationOciArtifact}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # If credentials are allowed via CORS. + ${AllowCorsCredential}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] - # The subscription identifier. - ${SubscriptionId}, + # The audience url for the service + ${Audience}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] - # Fully qualified resource id of the FHIR service to connect to. - ${FhirServiceResourceId}, + # The authority url for the service + ${Authority}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.IotIdentityResolutionType] - # Determines how resource identity is resolved on the destination. - ${ResourceIdentityResolutionType}, + [System.String[]] + # The headers to be allowed via CORS. + ${CorsHeader}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Int32] + # The max age to be allowed via CORS. + ${CorsMaxAge}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The methods to be allowed via CORS. + ${CorsMethod}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The origins to be allowed via CORS. + ${CorsOrigin}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # If the SMART on FHIR proxy is enabled + ${EnableSmartProxy}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # An etag associated with the resource, used for optimistic concurrency when editing it. ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent]))] - [System.Collections.Hashtable] - # The mapping. - ${FhirMappingContent}, + [System.String] + # The name of the default export storage account. + ${ExportStorageAccountName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("fhir-Stu3", "fhir-R4")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # The kind of the service. + ${Kind}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The resource location. ${Location}, + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Enabled", "Disabled")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Control permission for data plane traffic coming from public networks while private endpoint is enabled. + ${PublicNetworkAccess}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("no-version", "versioned", "versioned-update")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # The default value for tracking history across all resources. + ${ResourceVersionPolicyConfigurationDefault}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceVersionPolicyConfigurationResourceTypeOverrides]))] + [System.Collections.Hashtable] + # A list of FHIR Resources and their version policy overrides. + ${ResourceVersionPolicyConfigurationResourceTypeOverride}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, + + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2137,13 +1819,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareIotConnectorFhirDestination_CreateExpanded'; + CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareFhirService_CreateExpanded'; + CreateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\New-AzHealthcareFhirService_CreateViaIdentityWorkspaceExpanded'; + CreateViaJsonFilePath = 'Az.HealthcareApis.private\New-AzHealthcareFhirService_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.HealthcareApis.private\New-AzHealthcareFhirService_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2152,6 +1838,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2183,107 +1872,163 @@ end { <# .Synopsis -Creates or updates an IoT Connector resource with the specified parameters. +Create an IoT Connector FHIR destination resource with the specified parameters. .Description -Creates or updates an IoT Connector resource with the specified parameters. +Create an IoT Connector FHIR destination resource with the specified parameters. .Example $arr = @() -New-AzHealthcareIotConnector -Name azpsiotconnector -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Location eastus2 -IngestionEndpointConfigurationConsumerGroup "sajob-01-portal_input-01_consumer_group" -IngestionEndpointConfigurationEventHubName "sajob01portaleventhub" -IngestionEndpointConfigurationFullyQualifiedEventHubNamespace "sdk-Namespace-4761.servicebus.windows.net" -DeviceMappingContent @{"templateType"="CollectionContent";"template"=$arr} +New-AzHealthcareIotConnectorFhirDestination -FhirDestinationName azpsfhirdestination -IotConnectorName azpsiotconnector -ResourceGroupName azps_test_group -WorkspaceName azpshcws -FhirServiceResourceId "/subscriptions/{SubscriptionId}/resourceGroups/azps_test_group/providers/Microsoft.HealthcareApis/workspaces/azpshcws/fhirservices/azpsfhirservice" -ResourceIdentityResolutionType 'Create' -Location eastus2 -FhirMappingContent @{"templateType"="CollectionFhirTemplate";"template"=$arr} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination +.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. + +IOTCONNECTORINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link -https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareiotconnector +https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareiotconnectorfhirdestination #> -function New-AzHealthcareIotConnector { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotConnector])] +function New-AzHealthcareIotConnectorFhirDestination { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotFhirDestination])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('IotConnectorName')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [System.String] + # The name of IoT Connector FHIR destination resource. + ${FhirDestinationName}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of IoT Connector resource. - ${Name}, + ${IotConnectorName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription identifier. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. ${WorkspaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The subscription identifier. - ${SubscriptionId}, + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${IotconnectorInputObject}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IIotMappingPropertiesContent]))] - [System.Collections.Hashtable] - # The mapping. - ${DeviceMappingContent}, + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] - # An etag associated with the resource, used for optimistic concurrency when editing it. - ${Etag}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.ServiceManagedIdentityType] - # Type of identity being specified, currently SystemAssigned and None are allowed. - ${IdentityType}, + # Fully qualified resource id of the FHIR service to connect to. + ${FhirServiceResourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Create", "Lookup")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IUserAssignedIdentities]))] - [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, + [System.String] + # Determines how resource identity is resolved on the destination. + ${ResourceIdentityResolutionType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] - # Consumer group of the event hub to connected to. - ${IngestionEndpointConfigurationConsumerGroup}, + # An etag associated with the resource, used for optimistic concurrency when editing it. + ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [System.String] - # Event Hub name to connect to. - ${IngestionEndpointConfigurationEventHubName}, + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent]))] + [System.Collections.Hashtable] + # The mapping. + ${FhirMappingContent}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityIotconnectorExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] - # Fully qualified namespace of the Event Hub to connect to. - ${IngestionEndpointConfigurationFullyQualifiedEventHubNamespace}, + # The resource location. + ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] - # The resource location. - ${Location}, + # Path of Json file supplied to the Create operation + ${JsonFilePath}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IResourceTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, + [System.String] + # Json string supplied to the Create operation + ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -2353,13 +2098,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareIotConnector_CreateExpanded'; + CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareIotConnectorFhirDestination_CreateExpanded'; + CreateViaIdentityIotconnectorExpanded = 'Az.HealthcareApis.private\New-AzHealthcareIotConnectorFhirDestination_CreateViaIdentityIotconnectorExpanded'; + CreateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\New-AzHealthcareIotConnectorFhirDestination_CreateViaIdentityWorkspaceExpanded'; + CreateViaJsonFilePath = 'Az.HealthcareApis.private\New-AzHealthcareIotConnectorFhirDestination_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.HealthcareApis.private\New-AzHealthcareIotConnectorFhirDestination_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2368,6 +2118,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2399,67 +2152,159 @@ end { <# .Synopsis -Update the state of the specified private endpoint connection associated with the service. +Create an IoT Connector resource with the specified parameters. .Description -Update the state of the specified private endpoint connection associated with the service. +Create an IoT Connector resource with the specified parameters. .Example -{{ Add code here }} -.Example -{{ Add code here }} +$arr = @() +New-AzHealthcareIotConnector -Name azpsiotconnector -ResourceGroupName azps_test_group -WorkspaceName azpshcws -Location eastus2 -IngestionEndpointConfigurationConsumerGroup "sajob-01-portal_input-01_consumer_group" -IngestionEndpointConfigurationEventHubName "sajob01portaleventhub" -IngestionEndpointConfigurationFullyQualifiedEventHubNamespace "sdk-Namespace-4761.servicebus.windows.net" -DeviceMappingContent @{"templateType"="CollectionContent";"template"=$arr} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector +.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. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link -https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareprivateendpointconnection +https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareiotconnector #> -function New-AzHealthcarePrivateEndpointConnection { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription])] +function New-AzHealthcareIotConnector { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotConnector])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('PrivateEndpointConnectionName')] + [Alias('IotConnectorName')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] - # The name of the private endpoint connection associated with the Azure resource + # The name of IoT Connector resource. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the service instance. - ${ResourceName}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The subscription identifier. ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [System.String] + # The name of workspace resource. + ${WorkspaceName}, + + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IIotMappingPropertiesContent]))] + [System.Collections.Hashtable] + # The mapping. + ${DeviceMappingContent}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] - # A message indicating if changes on the service provider require any updates on the consumer. - ${PrivateLinkServiceConnectionStateActionsRequired}, + # An etag associated with the resource, used for optimistic concurrency when editing it. + ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] - # The reason for approval/rejection of the connection. - ${PrivateLinkServiceConnectionStateDescription}, + # Consumer group of the event hub to connected to. + ${IngestionEndpointConfigurationConsumerGroup}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus] - # Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - ${PrivateLinkServiceConnectionStateStatus}, + [System.String] + # Event Hub name to connect to. + ${IngestionEndpointConfigurationEventHubName}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Fully qualified namespace of the Event Hub to connect to. + ${IngestionEndpointConfigurationFullyQualifiedEventHubNamespace}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # The resource location. + ${Location}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, + + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -2529,13 +2374,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcarePrivateEndpointConnection_CreateExpanded'; + CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareIotConnector_CreateExpanded'; + CreateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\New-AzHealthcareIotConnector_CreateViaIdentityWorkspaceExpanded'; + CreateViaJsonFilePath = 'Az.HealthcareApis.private\New-AzHealthcareIotConnector_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.HealthcareApis.private\New-AzHealthcareIotConnector_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2544,6 +2393,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2575,21 +2427,42 @@ end { <# .Synopsis -Update the state of the specified private endpoint connection associated with the workspace. +Create the state of the specified private endpoint connection associated with the workspace. .Description -Update the state of the specified private endpoint connection associated with the workspace. +Create the state of the specified private endpoint connection associated with the workspace. .Example {{ Add code here }} .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription +.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. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/new-azhealthcareworkspaceprivateendpointconnection #> function New-AzHealthcareWorkspacePrivateEndpointConnection { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.Api20211101.IPrivateEndpointConnectionDescription])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -2598,44 +2471,71 @@ param( # The name of the private endpoint connection associated with the Azure resource ${PrivateEndpointConnectionName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription identifier. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. ${WorkspaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The subscription identifier. - ${SubscriptionId}, + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # A message indicating if changes on the service provider require any updates on the consumer. ${PrivateLinkServiceConnectionStateActionsRequired}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] [System.String] # The reason for approval/rejection of the connection. ${PrivateLinkServiceConnectionStateDescription}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityWorkspaceExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Support.PrivateEndpointServiceConnectionStatus] + [System.String] # Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. ${PrivateLinkServiceConnectionStateStatus}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2704,13 +2604,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.HealthcareApis.private\New-AzHealthcareWorkspacePrivateEndpointConnection_CreateExpanded'; + CreateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\New-AzHealthcareWorkspacePrivateEndpointConnection_CreateViaIdentityWorkspaceExpanded'; + CreateViaJsonFilePath = 'Az.HealthcareApis.private\New-AzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.HealthcareApis.private\New-AzHealthcareWorkspacePrivateEndpointConnection_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2719,6 +2623,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2781,19 +2688,34 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link -https://learn.microsoft.com/powershell/module/az.healthcareapis/remove-azhealthcareprivateendpointconnection +https://learn.microsoft.com/powershell/module/az.healthcareapis/remove-azhealthcareworkspaceprivateendpointconnection #> -function Remove-AzHealthcarePrivateEndpointConnection { +function Remove-AzHealthcareWorkspacePrivateEndpointConnection { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] - [Alias('PrivateEndpointConnectionName')] + [Parameter(ParameterSetName='DeleteViaIdentityWorkspace', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the private endpoint connection associated with the Azure resource - ${Name}, + ${PrivateEndpointConnectionName}, [Parameter(ParameterSetName='Delete', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] @@ -2801,12 +2723,6 @@ param( # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(ParameterSetName='Delete', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the service instance. - ${ResourceName}, - [Parameter(ParameterSetName='Delete')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] @@ -2814,13 +2730,24 @@ param( # The subscription identifier. ${SubscriptionId}, + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [System.String] + # The name of workspace resource. + ${WorkspaceName}, + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityWorkspace', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2895,14 +2822,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - Delete = 'Az.HealthcareApis.private\Remove-AzHealthcarePrivateEndpointConnection_Delete'; - DeleteViaIdentity = 'Az.HealthcareApis.private\Remove-AzHealthcarePrivateEndpointConnection_DeleteViaIdentity'; + Delete = 'Az.HealthcareApis.private\Remove-AzHealthcareWorkspacePrivateEndpointConnection_Delete'; + DeleteViaIdentity = 'Az.HealthcareApis.private\Remove-AzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentity'; + DeleteViaIdentityWorkspace = 'Az.HealthcareApis.private\Remove-AzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentityWorkspace'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2911,6 +2840,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2942,9 +2874,9 @@ end { <# .Synopsis -Deletes a private endpoint connection. +Update the state of the specified private endpoint connection associated with the workspace. .Description -Deletes a private endpoint connection. +Update the state of the specified private endpoint connection associated with the workspace. .Example {{ Add code here }} .Example @@ -2953,7 +2885,7 @@ Deletes a private endpoint connection. .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -System.Boolean +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription .Notes COMPLEX PARAMETER PROPERTIES @@ -2973,45 +2905,85 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link -https://learn.microsoft.com/powershell/module/az.healthcareapis/remove-azhealthcareworkspaceprivateendpointconnection +https://learn.microsoft.com/powershell/module/az.healthcareapis/update-azhealthcareworkspaceprivateendpointconnection #> -function Remove-AzHealthcareWorkspacePrivateEndpointConnection { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +function Update-AzHealthcareWorkspacePrivateEndpointConnection { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the private endpoint connection associated with the Azure resource ${PrivateEndpointConnectionName}, - [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(ParameterSetName='Delete')] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The subscription identifier. ${SubscriptionId}, - [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of workspace resource. ${WorkspaceName}, - [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # A message indicating if changes on the service provider require any updates on the consumer. + ${PrivateLinkServiceConnectionStateActionsRequired}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # The reason for approval/rejection of the connection. + ${PrivateLinkServiceConnectionStateDescription}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + ${PrivateLinkServiceConnectionStateStatus}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3053,12 +3025,6 @@ param( # Run the command asynchronously ${NoWait}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Returns true when the command succeeds - ${PassThru}, - [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] [System.Uri] @@ -3086,14 +3052,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - Delete = 'Az.HealthcareApis.private\Remove-AzHealthcareWorkspacePrivateEndpointConnection_Delete'; - DeleteViaIdentity = 'Az.HealthcareApis.private\Remove-AzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentity'; + UpdateExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareWorkspacePrivateEndpointConnection_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityExpanded'; + UpdateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityWorkspaceExpanded'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3102,6 +3070,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/internal/Remove-AzHealthcareWorkspacePrivateEndpointConnection.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/internal/Remove-AzHealthcareWorkspacePrivateEndpointConnection.ps1 index 2e56a94cd5e6..886faa8826b6 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/internal/Remove-AzHealthcareWorkspacePrivateEndpointConnection.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/internal/Remove-AzHealthcareWorkspacePrivateEndpointConnection.ps1 @@ -47,6 +47,21 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link https://learn.microsoft.com/powershell/module/az.healthcareapis/remove-azhealthcareworkspaceprivateendpointconnection #> @@ -55,6 +70,7 @@ function Remove-AzHealthcareWorkspacePrivateEndpointConnection { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityWorkspace', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the private endpoint connection associated with the Azure resource @@ -83,9 +99,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityWorkspace', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -160,14 +181,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Delete = 'Az.HealthcareApis.private\Remove-AzHealthcareWorkspacePrivateEndpointConnection_Delete'; DeleteViaIdentity = 'Az.HealthcareApis.private\Remove-AzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentity'; + DeleteViaIdentityWorkspace = 'Az.HealthcareApis.private\Remove-AzHealthcareWorkspacePrivateEndpointConnection_DeleteViaIdentityWorkspace'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -176,6 +199,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/internal/Remove-AzHealthcarePrivateEndpointConnection.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/internal/Update-AzHealthcareWorkspacePrivateEndpointConnection.ps1 similarity index 61% rename from generated/HealthcareApis/HealthcareApis.Autorest/internal/Remove-AzHealthcarePrivateEndpointConnection.ps1 rename to generated/HealthcareApis/HealthcareApis.Autorest/internal/Update-AzHealthcareWorkspacePrivateEndpointConnection.ps1 index 29c84743686b..2f2b7420824a 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/internal/Remove-AzHealthcarePrivateEndpointConnection.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/internal/Update-AzHealthcareWorkspacePrivateEndpointConnection.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Deletes a private endpoint connection. +Update the state of the specified private endpoint connection associated with the workspace. .Description -Deletes a private endpoint connection. +Update the state of the specified private endpoint connection associated with the workspace. .Example {{ Add code here }} .Example @@ -27,7 +27,7 @@ Deletes a private endpoint connection. .Inputs Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity .Outputs -System.Boolean +Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription .Notes COMPLEX PARAMETER PROPERTIES @@ -47,46 +47,85 @@ INPUTOBJECT : Identity Parameter [ResourceName ]: The name of the service instance. [SubscriptionId ]: The subscription identifier. [WorkspaceName ]: The name of workspace resource. + +WORKSPACEINPUTOBJECT : Identity Parameter + [DicomServiceName ]: The name of DICOM Service resource. + [FhirDestinationName ]: The name of IoT Connector FHIR destination resource. + [FhirServiceName ]: The name of FHIR Service resource. + [GroupName ]: The name of the private link resource group. + [Id ]: Resource identity path + [IotConnectorName ]: The name of IoT Connector resource. + [LocationName ]: The location of the operation. + [OperationResultId ]: The ID of the operation result to get. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [ResourceGroupName ]: The name of the resource group that contains the service instance. + [ResourceName ]: The name of the service instance. + [SubscriptionId ]: The subscription identifier. + [WorkspaceName ]: The name of workspace resource. .Link -https://learn.microsoft.com/powershell/module/az.healthcareapis/remove-azhealthcareprivateendpointconnection +https://learn.microsoft.com/powershell/module/az.healthcareapis/update-azhealthcareworkspaceprivateendpointconnection #> -function Remove-AzHealthcarePrivateEndpointConnection { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +function Update-AzHealthcareWorkspacePrivateEndpointConnection { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IPrivateEndpointConnectionDescription])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Delete', Mandatory)] - [Alias('PrivateEndpointConnectionName')] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the private endpoint connection associated with the Azure resource - ${Name}, + ${PrivateEndpointConnectionName}, - [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [System.String] # The name of the resource group that contains the service instance. ${ResourceGroupName}, - [Parameter(ParameterSetName='Delete', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] - [System.String] - # The name of the service instance. - ${ResourceName}, - - [Parameter(ParameterSetName='Delete')] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The subscription identifier. ${SubscriptionId}, - [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [System.String] + # The name of workspace resource. + ${WorkspaceName}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityWorkspaceExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Models.IHealthcareApisIdentity] + # Identity Parameter + ${WorkspaceInputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # A message indicating if changes on the service provider require any updates on the consumer. + ${PrivateLinkServiceConnectionStateActionsRequired}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # The reason for approval/rejection of the connection. + ${PrivateLinkServiceConnectionStateDescription}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Body')] + [System.String] + # Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + ${PrivateLinkServiceConnectionStateStatus}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -128,12 +167,6 @@ param( # Run the command asynchronously ${NoWait}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Returns true when the command succeeds - ${PassThru}, - [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Category('Runtime')] [System.Uri] @@ -161,14 +194,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - Delete = 'Az.HealthcareApis.private\Remove-AzHealthcarePrivateEndpointConnection_Delete'; - DeleteViaIdentity = 'Az.HealthcareApis.private\Remove-AzHealthcarePrivateEndpointConnection_DeleteViaIdentity'; + UpdateExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareWorkspacePrivateEndpointConnection_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityExpanded'; + UpdateViaIdentityWorkspaceExpanded = 'Az.HealthcareApis.private\Update-AzHealthcareWorkspacePrivateEndpointConnection_UpdateViaIdentityWorkspaceExpanded'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -177,6 +212,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/HealthcareApis/HealthcareApis.Autorest/test-module.ps1 b/generated/HealthcareApis/HealthcareApis.Autorest/test-module.ps1 index 70b5b166f0ab..cdea21c51158 100644 --- a/generated/HealthcareApis/HealthcareApis.Autorest/test-module.ps1 +++ b/generated/HealthcareApis/HealthcareApis.Autorest/test-module.ps1 @@ -12,17 +12,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- -param([switch]$Isolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) +param([switch]$NotIsolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) $ErrorActionPreference = 'Stop' -if(-not $Isolated) +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' if ($PSBoundParameters.ContainsKey("TestName")) { $PSBoundParameters["TestName"] = $PSBoundParameters["TestName"] -join "," } $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path - & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } @@ -34,7 +34,7 @@ if ($PSBoundParameters.ContainsKey("TestName") -and ($TestName.count -eq 1) -and $ProgressPreference = 'SilentlyContinue' $baseName = $PSScriptRoot.BaseName $requireResourceModule = (($baseName -ne "Resources") -and ($Record.IsPresent -or $Live.IsPresent)) -. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule +. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -NotIsolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule . ("$PSScriptRoot\test\utils.ps1") if ($requireResourceModule) @@ -95,4 +95,4 @@ try } } -Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file +Write-Host -ForegroundColor Green '-------------Done-------------'